填空题
请补充fun函数,fun函数的功能是求n的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句
试题程序:
#include<stdio.h>
long fun(int n)
if(
(1)
)
return(n*fun(
(2)
));
return
(3)
;
main()
printf("10!=%1d\n",fun(10));
【参考答案】
1或11或1L
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
n-1
点击查看答案
问答题
编写函数fun,其功能是:根据以下公式求值(要求精度0.0005,即某项小于0.0005时停止迭代)。 程序运行后,若输入精度0.0005,则程序应输出为3.14… 注意:部分源程序已给出。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。 试题程序: #include<stdio.h> #include<conio.h> #include<math.h> double fun(double eps) void main () double x; printf( Input eps: ); scanf( %If”,&x); printf( neps=%If,PI=%1f n ,x,fun(x));
点击查看答案&解析
相关试题
编写函数fun,其功能是:根据以下公式求值...
n-1
下列给定程序中函数fun的功能是:统计subst...
n>1或1<n