Q.Integration of 1/(1+x^2) within the limit (1,6)
#include<
float f(float a)
{
float b;
b=(1/(1+(a*a)));
return b;
}
int main()
{
int i,m=1,n=6;
float y[7],z=0.0,w,h=1.0;
for(i=m;i<=n;i++)
{
y[i]=f(i);
printf("x=%d,y[%d]=%f\n",i,i,y[i]);
}
for(i=1;i<=n-1;i++)
{
z=z+y[i];
}
w=(((y[0]+y[n])+(2*z)));
printf("\nAns= %f\n",w);
return 0;
}
Nov 18, 2008
Trapezoidal Rule
Posted by
bikash pradhan
at
1:11 AM
Labels: Trapezoidal Rule C program code
Subscribe to:
Post Comments (Atom)
Search
Programs
- backward difference formula c program code (1)
- Bisection Method c program code (1)
- Cramers rule (1)
- False position (1)
- Forward Difference Formula c program code (1)
- Gauss Seidal Method c program code (1)
- Guass Elimination Method c program code (1)
- Method of Successive Approximation c program code (1)
- Newton Raphson Method c program code (1)
- Newton's Backward Interpolation Formula c program code (1)
- Newton's Forward Interpolation Formula c program code (1)
- Regula Falsi on False Position Method c program code (1)
- Simpson's 1/3 Rule c program code (1)
- Simpson's Simpsons' 3/8 rule c program code (1)
- Trapezoidal Rule C program code (1)
0 comments:
Post a Comment