Skip to content

Instantly share code, notes, and snippets.

@philorocha
Created May 8, 2018 00:08
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 philorocha/bf714391de2ac8f0ae53778fcc6677f2 to your computer and use it in GitHub Desktop.
Save philorocha/bf714391de2ac8f0ae53778fcc6677f2 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int fatorial(int num) {
if (num == 0 || num == 1) {
return 1;
}
if (num > 1) {
return num * fatorial(num - 1);
}
}
int main(void) {
printf("%d\n", fatorial(1));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment