Q. What will be the output of the given code?
Code:for num in 1...5 puts num end
Dear candidates you will find MCQ questions of Ruby here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
for num in 1...5 puts num end
for i in 1...3 for j in 1..3 puts j end end
for num in 1...4 puts num*num end
i=1 for i in 6..10 puts i**2 end
for i in 1..5 && j in 5..10 puts i+j end
counter = 1 while counter < 5 puts counter counter = counter + 1 end
counter = true while counter !=false puts counter end
while a&&b puts a end
a=1 b=1 while a&&b puts a+b end
i = 4 while i > 0 do print i i -= 1 end