#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
cout<<"\t\t\t    WELCOME TO POLYNOMIAL INTEGRATION\n";
int deg;
cout<<"Enter degree of polynomial (< 100):";
cin>>deg;
float coeff[100];
cout<<"Enter coefficents from consttant term to x^"<<deg<<"\n";
for(int i=0;i<=deg;i++)
cin>>coeff[i];
float ll,ul;
cout<<"Enter lower limit and upper limit\n";
cin>>ll>>ul;
double I(double var,float arr[],int n);
double DI=I(ul,coeff,deg)-I(ll,coeff,deg);
cout<<"Definite Integral is :"<<DI;
getch();
}

double I(double x,float ar[],int n)
{
double integral=0;
for(int j=0;j<=n;j++)
{
integral+=((ar[j])*(pow(x,j+1))/(j+1));
}
return integral;
}

