dgadiraju
5/7/2017 - 2:00 AM

fibo-func.scala

def fibo(i: Int) = {
  var pre = 0
  var curr = 1
  var res = 0
  print(pre + "\t" + curr)
  for(e <- 2 to i - 1) {
    res = pre + curr
    pre = curr
    curr = res
    print("\t" + res)
  }
}