MCQs > IT & Programming > Ruby > What is the output of the Ruby code (with line numbers) shown below? 1. (0...5).each do |i| 2. puts 'Value of local variable is #{i}' 3. end

Ruby MCQs

What is the output of the Ruby code (with line numbers) shown below?

1. (0...5).each do |i|

2. puts "Value of local variable is #{i}"

3. end


Answer

Correct Answer:

Value of local variable is 0

Value of local variable is 1

Value of local variable is 2

Value of local variable is 3

Value of local variable is 4 


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it