عنوان 

  انتگرال به روش سیمپسون زبان

توضیحات :

نوع فایل

فرمت

سورس زبان سی

CPP , EXE

پیش نمایش از پروژه

#include<stdio.h>
#include<conio.h>
#include<math.h>
float f(float x);
void main()
{
float k=0.0, h,x,a,b;
int i,n;
clrscr();
printf(“f(x)=1/(1+x*x)”);
printf(“\nEnter upper and lower limits:”);
printf(“\n\na=”);
scanf(“%f”,&a);
printf(“\nb=”);
scanf(“%f”,&b);
printf(“\nEnter no. of limits of 2:”);
scanf(“%d”,&n);
h=(b-a)/(2*(n/2));
printf(“\n x\t\t\t f(x)”);
for(x=a,i=0;x<b;x=x+(2*h),i=i+2)
{
k+=f(x)+4*f(x+h)+f(x+2*h);
printf(“\n%0.6f\t%15.6f”,x,f(x));
printf(“\n%0.6f\t%15.6f”,x+h,f(x+h));
}
printf(“\n%0.6f\t%15.6f”,x,f(x+h));

}

simpson

======