output=['five','four','three','two','one','zero']puts"Input Converted to:"output=output.reverseoutput.eachdo|text|putstextendputsoutput.each_with_indexdo|text,index|puts"Index #{index} holds the value #{text}"end
Input Converted to:
zero
one
two
three
four
five
Index 0 holds the value zero
Index 1 holds the value one
Index 2 holds the value two
Index 3 holds the value three
Index 4 holds the value four
Index 5 holds the value five