Skip to content

Instantly share code, notes, and snippets.

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 bhaveshmunot1/e6394646318cb671b255a2775599af31 to your computer and use it in GitHub Desktop.
Save bhaveshmunot1/e6394646318cb671b255a2775599af31 to your computer and use it in GitHub Desktop.
Without recursion implementation to demonstrate how recursion unfolds.
int factorial_1() {
return 1;
}
int factorial_2() {
int fact_1 = factorial_1();
return 2 * fact_1;
}
int factorial_3() {
int fact_2 = factorial_2();
return 3 * fact_2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment