All Programs are Written and Compiled in Dev C++. So, it may generate some error in case of other compilers and may need some modifications in program. Download Dev C++
#include<iostream>
using namespace std;
int main()
{
int i,n;
float x[10],y[10],h,sum;
cout<<
"Enter no of values in table: ";
cin>>n;
cout<<
"Enter X & corresponding Y:\n";
for(i=0;i<n;i++)
cin>>x[i]>>y[i];
#include<iostream>
#include<math.h>
using namespace std;
float f(float x)
{
return 1/(1+x*x);
//Function f(x)
}
int main()
{
int i,n;
float x0,xn,h,sum;
cout<<
"Enter no of Intervals: ";
#include<iostream>
using namespace std;
int main()
{
int i,j,k,n;
float x[10],y[10],sum,h;
cout<<
"Enter no of Values in table: ";
cin>>n;
cout<<
"Enter X and corresponding Y\n";
#include<iostream>
#include<math.h>
using namespace std;
float f(float x)
{
return 1/(1+x*x);
}
int main()
{
int i,n;
float x0,xn,h,sum;
cout<<
"Enter no of Intervals: ";