aboutsummaryrefslogtreecommitdiff
path: root/entries/komodoooo/fib.rb
blob: ce25eebf33429748276f13032e75618d7a4dfa79 (plain) (blame)
1
2
3
4
5
6
7
8
9
def fibonacci(n)
    a,b=0,1
    while a<n
        puts"#{a} "
        a,b=b,a+b
    end
end
print"Number: "
fibonacci(gets.chomp.to_i)