Ruby - Write program to output number from 1 to 5

Requirements

Write program to output number from 1 to 5

Hint

You create a temporary array containing the numbers one through five and use the each iterator to pass each value into the code block.

Assigning each value to number that you then print to the screen with puts.

Demo

[1,2,3,4,5].each { |number| puts number }

Result

Related Exercise