Ruby is a dynamic, open source programming language focused on simplicity and productivity. It is the language that powers the Ruby on Rails web framework.

How to test

Prerequisites: Ruby

  • Ubuntu/Debian: sudo apt install ruby
  • macOS: brew install ruby
  • All platforms: https://www.ruby-lang.org/en/downloads/
ruby fibonacci.rb

Expected output:

0
1
1
2
3
5
8
13
21
34

Source Code

a, b = 0, 1
10.times do
    puts a
    a, b = b, a + b
end

Local Testing Screenshot Image