Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created May 18, 2014 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/ad5084c71f1e37216b6a to your computer and use it in GitHub Desktop.
Save adilakhter/ad5084c71f1e37216b6a to your computer and use it in GitHub Desktop.
factorial
def factorial(n: Int): Int = {
if (n<=0)
1
else
n * factorial(n-1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment