Hi,

I can't figure out where is the problem.Please help me to correct my code

Code:#include <stdio.h> #include <math.h> void trap(double a,double b, int n, double *areag, double *areah); double g(double x); double h(double x); int main(void) { double areag = 0.0, areah = 0.0; double a1 = 0, b1 = 10; int n; for(n=2;n<=128;n*=2){ trap(a1, b1, n, &areag, &areah); printf("%f %f\n", areag, areah); } return(0); } double g(double x){ return(pow(x,2)*sin(x)); } double h(double x){ return(sqrt(4-pow(x,2))); } void trap(double a,double b, int n, double *areag, double *areah){ int i, l; *areag = (b-a)/2*n * ( g(a) + g(b)); for(i = 1; i<=n-1;i++) *areag += 2*g(i); *areah = (b-a)/2*n * ( h(a) + h(b)); for(l=1;l<=n-1;l++) *areah += 2*h(i); }