Created
July 25, 2014 00:30
-
-
Save krishnabhargav/8e07a7ea4b5be6b789fa 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 factorial(num : Int) : Int = { | |
if(num > 1) num * factorial (num-1) else num | |
} | |
factorial(5) ///will print 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment