Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.