以下程序中,函数fun的功能是计算x2-2x+6,主函数中将调用fun函数计算: y1=(x+8)2-2(x+8)+6 y2=sin2(x)-2sin(x)+6 请填空。 #include "math.h" double fun(double x

admin2010-12-10  47

问题 以下程序中,函数fun的功能是计算x2-2x+6,主函数中将调用fun函数计算:
y1=(x+8)2-2(x+8)+6
y2=sin2(x)-2sin(x)+6
请填空。
#include  "math.h"
double fun(double x){return(x*x-2*x+6);}
main()
{ double  x,y1,y2;
  printf("Enter x: "); scanf("%lf",&x);
    y1=fun(【  】);y2=fun(【  】);
    printf("y1=%lf,y2=%lf\n",y1,y2);
}

选项

答案x+8 , sin(x)

解析 用x+8代替函数fun( double x)中形式参数x。用sin(x)代替函数fun( double x)中形式参数x。
转载请注明原文地址:https://jikaoti.com/ti/6yB0FFFM
0

最新回复(0)