第三分册 上机考试题库
第1套
一、填空题
给定程序的功能是求 1/4 的圆周长。函数通过形参得到圆的直径,函数返回 1/4 的圆周长
(圆周长公式为:L=Πd,在程序中定义的变量名要与公式的变量相同)。
例如:输入圆的直径值:19.527,输出为:15.336457
请勿改动主函数 main 与其他函数中的任何内容,仅在横线上填写所需的若干表达式或语句。
#include<stdio.h>
double fun(double d)
{
return 3.14159*d/4.0;
}
main()
{
double z;
printf("Input the d of the round:");
scanf("%lf",&z);
printf("L=%lf\n",fun(z));
6
23
}
...
附件列表