printf("Input the lower value, a, to integrate:\n");
scanf("%f",&a);
printf("Input the upper value, b, to integrate:\n");
scanf("%f",&b);
printf("Enter even integer for n:\n");
scanf("%d",&n);
if(b>=a)
{
if(!(n%2))
{
T=trapezoidal(a,b,n);
S=simpson(a,b,n);
}
else
printf("n must be an even, positive integer");
}
else
printf("b must be greater than a");
system("PAUSE");
return 0;
}
float trapezoidal(float a, float b, int n)
{
float x,
T,
k;