What is a c program to implement trapezoidal and Simpson's methods?
ITS EASY...TRY THIS OUT..TRAPEZOIDAL METHOD#include#include#includefloat valcal(float x){return (x*x*x);}int main(){float a,b,h,c,I;int n,i;printf("THE TRAPEZOIDAL RULE:\n");printf("---------------------");printf("\n\n\nEnter the two limits and the no. of divisions:\n");scanf("%f %f %d",&a, &b, &n);h=(b-a)/n;//printf("\nVALUE of h: %f\n", h);c=a;I=valcal(a)+valcal(b);//printf("\nVALUE FOR a: %f\n", valcal(a));//printf("\nVALUE FOR b: %f\n", valcal(b));for(i=1;i=b){printf("\n\nc>b\n\n");break;}//printf("\nVALUE FOR %f: is %f\n",c, valcal(c));I=I+(2*valcal(c));//printf("\nI right now is %f", I);}printf("\n\n\nThe integration of x*x*x is: %f",(h*I)/2);printf("\n\n\n");system("pause");}SIMPSON'S 1/3RD METHOD#include#include#includefloat valcal(float x){return (1/(1+x*x));}int main(){float a,b,h,c,I;int n,i;printf("THE SIMPSON'S ONE-THIRD RULE:\n");printf("------------------------------");printf("\n\n\nEnter the two limits and the no. of divisions:\n");scanf("%f %f %d",&a, &b, &n);h=(b-a)/n;//printf("\nVALUE of h: %f\n", h);c=a;I=valcal(a)+valcal(b);//printf("\nVALUE FOR a: %f\n", valcal(a));//printf("\nVALUE FOR b: %f\n", valcal(b));for(i=1;ib){printf("\n\nc>b\n\n");break;}//printf("\nVALUE FOR %f: is %f\n",c, valcal(c));if(i%2==0)I=I+(2*valcal(c));elseI=I+4*valcal(c);//printf("\nI right now is %f", I);}printf("\n\n\nThe integration of x*x*x is: %f",(h*I)/3);printf("\n\n\n");system("pause");}NEED MORE HELP...MAIL ME YOUR PROB... SEE YA