问题 问答题

以下是某C程序段,其功能为计算输入数字的阶乘。请仔细阅读程序并完成要求。
# incllade<stdiO.h>
# incllade<stdl ib.h>
int main()

int i:0;/*i为计数器*/
int n:
int factorial=1;/*保存阶乘的结果*/
puts("*************************************"):
puts("* The program will compute*");
puts("* the fact。tial 0f an integer*");
puts("*************************************"):
puts("please input the number n:");
scanf("%d’,&n);
if(n<0)/*判断输入的数是否大于或等于0*/

printf("please input an interget>=0.\n");
return 0:

if(n==0)/*0的阶乘是1*/

printf("fa(:tOrial of 0 is 1.\n");
return 0:

i=1:
while(i<=n)

factorial:factorial * i:
i++:

printf("factorial of %d is:%d.\n’,n,factorial);
getch();
return 0:

出此程序主函数的控制流程图。

答案

参考答案:主程序的控制流程图如下:
[*]

单项选择题
填空题