📄 funciones_factorial.cpp
字号:
//Calcule el factoriql de un numero usando funciones
#include<stdio.h>
#include<conio.h>
#include<math.h>
int g(int n)
{
int producto,i;
producto=1;
for(i=1;i<=n;++i)
producto=producto*i;
return producto;
}
main()
{
int a,factorial;
printf("Dame un numero\n");
scanf("%d",&a);
factorial=g(a);
printf("Su factorial es es %d",g(a));
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -