Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Last active May 8, 2017 01:31
Show Gist options
  • Save dgadiraju/8e57dd20b00419752ad5c42edd0f6dae to your computer and use it in GitHub Desktop.
Save dgadiraju/8e57dd20b00419752ad5c42edd0f6dae to your computer and use it in GitHub Desktop.
val a = 10
var pre = 0
var curr = 1
println(pre)
println(curr)
var res = 0
for(e <- 2 to a - 1) {
res = pre + curr
println(res)
pre = curr
curr = res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment