当前位置:网站首页>C language: recursively implementing factorial of n
C language: recursively implementing factorial of n
2022-06-24 00:16:00 【Nianchi ichthyology programming】
#include <stdio.h>
long f(int x);
int main()
{
int a;
printf(" Please enter the number of factorials to be calculated :");
scanf("%d",&a);
printf("%d The factorial of is :%d\n",a,f(a));
return 0;
}
long f(int x)
{
long g;
if(x<0){
printf("x<0, Incorrect input !");
}
else if(x==1 || x==0){
g = 1;
}else{
g = x*f(x-1);
}
return g;
}
边栏推荐
- [interview experience package] summary of experience of being hanged during interview (I)
- Perfectionist win10 installation guide
- DO280OpenShift访问控制--管理项目和账户
- Security | warm tips: security incidents on the cloud have intensified recently. Please do a good job in backup monitoring of cloud security protection!
- kubernetes之常用核心资源对象
- Empty encoded password警告原因
- All 32 keyword classifications of C language C89 (C90)
- 国内首款开源MySQL HTAP数据库即将发布,三大看点提前告知 石原子科技重磅推出
- Revit API: schedule viewschedule
- 9次Android面试经验总结,已收字节,阿里,高级android面试答案
猜你喜欢

Usage of go in SQL Server

如何入门机器学习?

C语言:结构体数组实现找出最低分学生记录

Return, const, volatile keywords

【红绿灯识别】基于matlab GUI红绿灯识别【含Matlab源码 1908期】

使用worker报错:Uncaught DOMException: Failed to construct ‘Worker’: Script at***

The first open-source MySQL HTAP database in China will be released soon, and the three highlights will be informed in advance that shiatomics technology will launch heavily

What should I pay attention to in the interview of artificial intelligence technology?
![[image detection saliency map] calculation of fish eye saliency map based on MATLAB distortion prompt [including Matlab source code 1903]](/img/36/134c573c2198ca6c88a7c179189f1a.jpg)
[image detection saliency map] calculation of fish eye saliency map based on MATLAB distortion prompt [including Matlab source code 1903]

Android 3年外包工面试笔记,有机会还是要去大厂学习提升,android开发实习面试题
随机推荐
Android 7,2021最新Android面试笔试题目分享
Learn PWN from CTF wiki - ret2text
Three Solution to the problem of inaccuracy in radiographic testing under the condition of non full screen canvas of JS
Return, const, volatile keywords
毕业设计-论文写作笔记【毕设题目类型、论文写作细节、毕设资料】
Using anydesk remote control for intranet penetration horizontal movement
[leetcode notes] no118 Yanghui triangle
First week of summer vacation
New function of lightweight application server: simple experience of offline business migration by using image sharing
利用Scanorama高效整合异质单细胞转录组
Use of reverse tools IDA and GDB
Throttling and anti shake
I was cheated by my colleagues to work overtime on weekends. I haven't seen redis used like this...
逻辑的定义
Andorid development art exploration notes (2), cross platform applet development framework
Andorid 开发艺术探索笔记(2),跨平台小程序开发框架
Windows10 security mode entry cycle blue screen repair
Six necessary open source projects for private activities
Tiktok practice ~ one click registration and login process of mobile phone number and password (restrict mobile terminal login)
2022考研经验分享【初试、择校、复试、调剂、校招与社招】