16/11/2022 ; 5:28 PM

This commit is contained in:
2022-11-16 17:32:01 -04:00
parent 6ca133770c
commit 5530947414
17 changed files with 512 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# include <stdio.h>
/* Factorial.
El programa calcula el factorial de un número entero.
FAC, I, NUM: variables de tipo entero. */
void main(void)
{
int I, NUM;
long FAC;
printf("\nIngrese el numero: ");
scanf("%i", &NUM);
if (NUM >= 0)
{
FAC = 1;
for (I = 1; I <= NUM; I++)
FAC *= I;
printf("\El factorial de %i es: %ld", NUM, FAC);
}
else
printf("\nError en el dato ingresado");
}