Created
May 7, 2017 01:53
-
-
Save dgadiraju/3b4759ac35948afd74492534e5d4424d to your computer and use it in GitHub Desktop.
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
def fact(i: Int) = { | |
var res = 1 | |
for(e <- i to 1 by -1) | |
res = res * e | |
res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment