#include #include int factorial(int n) { int fact = 1; int i; for(i=1;i<=n;i++) { fact = fact * i; } return fact; } int main() { int n, f; printf("Factorial de n (1 * 2 * 3 * ... * n)\n"); printf("Dame el valor de n: "); scanf("%d", &n); f=factorial(n); printf("El factorial de %d es %d\n", n, f); printf("El factorial de %d es %d\n", n+1, factorial(n+1)); system("pause"); return 0; }