import "/std"; println("Iterative Fibonacci example"); let fib = (n: I32) { let mut prevprevn = 0; let mut prevn = 0; let mut curn = 1; let mut i = 2; while i <= n { prevprevn = prevn; prevn = curn; curn = prevprevn + prevn; i = i + 1; }; curn }; print("Enter a number: "); let n = read_num(); let fib_number: I32 = fib(n); print("Fibonacci of "); printn(n); print(" is "); printnln(fib(n)); println("")