Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def fib
def fib(first_num, second_num)
limit = 11
while second_num < limit
sum = first_num + second_num
first_num = second_num
second_num = sum
end
sum
end
result = fib(0, 1)
puts "result is #{result}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.