Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Tính gần đúng tích phân(Simpson)

View previous topic View next topic Go down

Tính gần đúng tích phân(Simpson)

Post  Admin on Thu Jun 09, 2011 3:04 am

//Tinh tich phan bang cong thuc Simpson
#include <stdio.h>
#include <conio.h>

float f(float x)
{
return (15-2*x)/(3*x+7.2);
}

void main()
{
float a;
float b;
int n;
float h;
float S=0;
int i;

clrscr();
printf("a=");
scanf("%f",&a);
while (3*a+7.2==0)
{
printf("\Khong hop le!Nhap lai");
printf("\na=");
scanf("%f",&a);
}

printf("b=");
scanf("%f",&b);
while (3*b+7.2==0)
{
printf("\Khong hop le!Nhap lai");
printf("\nb=");
scanf("%f",&b);
}

printf("\nn=");
scanf("%d",&n);
while (n%2!=0)
{
printf("\nn phai la so chan!Nhap lai!");
printf("\nn=");
scanf("%d",&n);
}
h=(b-a)/n;

for (i=0;i<=n-2;i=i+2)
S+=(f(a+i*h)+4*f(a+(i+1)*h)+f(a+(i+2)*h))*h/3;

printf("\nS=%f",S);
getch();
}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum