填空题

以下函数的功能是计算
请填空。
double fun(int n)
double s=0.0,fac=1.0;int i;
for(i=1;i<=n;i++)
fac=fac 【12】 ;
s=s+fac;

return s;

【参考答案】

/i或*(1.O/i)或/(double)i
<上一题 目录 下一题>
热门 试题

填空题
下面程序的运行结果是: 【18】 。 void swap(int *a,int*b) int *t; t=a;a=b;b=t; main() intx=3,y=5,*p=&x,*q=&y; swap(p,q); printf(“%d%d n”,*p,*q);
填空题
有以下程序: #include<stclio.h> main() char c; while((c=getchar())!=’’)putchar(--c); 程序运行时,如果从键盘输入:YN<回车>,则输出结果为 【10】 。
相关试题
  • 若fp已正确定义为一个文件指针,d1.dat为...
  • 下面程序的运行结果是: 【19】 。 ty...
  • 以下程序运行后的输出结果是 【11】 。...
  • 函数sstrcmp()的功能是对两个字符串进行...
  • fun函数的功能是:首先对a所指的N行N列的矩...