Consider an array "colors" which has the following contents:
colors= ["Red", "Blue", "Yellow", "Green", "Violet", "Black"]
Which of the given options will print the following output?
Red
Blue
Yellow
Green
Violet
Black
Correct Answer:
colors= ["Red", "Blue", "Yellow", "Green", "Violet", "Black"]
for color in 0...colors.length
print colors[color], "\n"
end
Explanation:
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
More Ruby MCQ Questions