Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Last active May 8, 2017 01:30
Show Gist options
  • Save dgadiraju/8e1a4823d452f0aa247a72b8d49012ae to your computer and use it in GitHub Desktop.
Save dgadiraju/8e1a4823d452f0aa247a72b8d49012ae to your computer and use it in GitHub Desktop.
val a = 5
var res = 1
for(e <- a to 2 by -1)
res = res * e
println("Factorial of " + a + " is " + res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment