Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find N! using recursion.
int factorial(int n) {
if (n == 1) {
return 1;
}
int fact_n_1 = factorial(n-1);
return n * fact_n_1;
}
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.