Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created July 16, 2012 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesidays/3121942 to your computer and use it in GitHub Desktop.
Save yesidays/3121942 to your computer and use it in GitHub Desktop.
Factorial
#include <stdio.h>
int main() {
int c, n, fact = 1;
printf("Ingrese el numero que desea calcular su factorial: ");
scanf("%d", &n);
for (c = 1; c <= n; c++)
fact = fact * c;
printf("El factorial de %d es %d\n", n, fact);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment