SHOWFACT.C
资源名称:C.rar [点击查看]
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:0k
源码类别:
界面编程
开发平台:
C/C++
- #include <stdio.h>
- int factorial(int value)
- {
- printf("In factorial with the value %dn", value);
- if (value == 1)
- {
- printf("Returning the value 1n");
- return(1);
- }
- else
- {
- printf("Returning %d * factorial(%d)n",
- value, value-1);
- return(value * factorial(value-1));
- }
- }
- void main(void)
- {
- printf("The factorial of 4 is %dn", factorial(4));
- }