A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Fibonacci in Ruby page! Here, you'll find the source code for this program as well as a description of how the program works.
def fibonacci(number)
a = 0
b = 1
c = 0
i = 0
while i < number
c = a + b
b = a
a = c
print("#{i+1}: #{c}\n")
i += 1
end
end
num = Integer(ARGV[0]) rescue -1
if num >= 0
fibonacci(num)
else
print("Usage: please input the count of fibonacci numbers to output")
end
Fibonacci in Ruby was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.