C语言函数计算值:fun(x) = x^2 - 2x + 6
#include 'stdio.h'
(1)
float fun(float x)
{ float y;
y=xx-2x+6;
(2) ;
}
int main()
{ float x,y1,y2;
scanf("%f",&x);
y1=fun( (3) );
y2=fun( (4) );
printf("y1=%f,y2=%f ",y1,y2);
}
答案:
(1) 函数声明:float fun(float x); (2) 返回计算结果:return y; (3) 调用fun函数时传入参数x:x (4) 调用fun函数时传入参数x+1:x+1
AI 优化版
原文地址:https://www.cveoy.top/t/topic/nVLQ 著作权归作者所有。请勿转载和采集!