Created
June 3, 2020 09:23
-
-
Save bhaveshmunot1/e6394646318cb671b255a2775599af31 to your computer and use it in GitHub Desktop.
Without recursion implementation to demonstrate how recursion unfolds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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