Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Last active August 29, 2015 14:13
Show Gist options
  • Save joffilyfe/7a81ba3c70b599334c0c to your computer and use it in GitHub Desktop.
Save joffilyfe/7a81ba3c70b599334c0c to your computer and use it in GitHub Desktop.
#include <stdio.h>
int fazFatorial(int numero);
int main(void) {
int numero;
scanf("%d", &numero);
printf("%d\n", fazFatorial(numero));
return 0;
}
int fazFatorial(int numero) {
int i = 0;
for (i = numero; i > 1; i--) {
numero *= i - 1;
}
return numero;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment