给定函数y=x 用c语言,求y的不定积分. 要写出相应的c语言程序.

2025-04-04 11:18:13
推荐回答(3个)
回答1:

# include
void main()
{ float f1(float);
float f2(float);
float f3(float);
float f4(float);
float f5(float);
float integral(float,float,float(*fun)(float));
float a,b;
int i;
float k[5];
printf("enter a,b:\n"); scanf("%f,%f",&a,&b); k[0]=integral(a,b,f1); k[1]=integral(a,b,f2); k[2]=integral(a,b,f3); k[3]=integral(a,b,f4); k[4]=integral(a,b,f5);
for(i=0;i<=5;i++) printf("k[%d]=%f\n",i,k[i]); }
float f1(float x)
{ float z; z=x+x*x/2;
return z; }
float f2(float x)
{ float z; z=3*x+x*x; return z; } float f3(float x) { float z; z=x+(float)(exp(x)); return z; } float f4(float x) { float z; z=2*(1+x); return z; } float f5(float x) { float z; z=(float)(pow(x,4))/4; return z; }

回答2:

includ
main()
int x,y;
y=x;
y=1/2x2;
printf(%d,&y);

回答3:

C语言:
main(){
int y,x;
y=x;
for i=0;i<=100;i++
if y==sqrt(x) printf(y);

}