Created
October 16, 2016 20:06
-
-
Save BSVino/db0806c5bcfe74bb6d82bdcc76f664b4 to your computer and use it in GitHub Desktop.
Factorial example
This file contains hidden or 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
| unsigned int factorial(unsigned int n) { | |
| if (n == 0) | |
| return 1; | |
| return n * factorial(n - 1); | |
| } | |
| int main(int argc, char** args) { | |
| return factorial(2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment