Created
May 20, 2016 17:06
-
-
Save hosamshahin/fc1a34e5d912543a3aeb9618098f79c0 to your computer and use it in GitHub Desktop.
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
public int factorial(int n) | |
{ | |
int result = 1; | |
for (int i = 1; i <= n; i++) { | |
result = result * i; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment