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
V
Q. What will be the output of the given code?
for num in 1...5 puts num end
V
Q. What will be the output of the given code?
for i in 1...3 for j in 1..3 puts j end end
V
Q. What will be the output of the given code?
for num in 1...4 puts num*num end
V
Q. What will be the output of the given code?
i=1 for i in 6..10 puts i**2 end
V
Q. What will be the output of the given code?
for i in 1..5 && j in 5..10 puts i+j end
V
Q. What will be the output of the given code?
counter = 1 while counter < 5 puts counter counter = counter + 1 end
V
Q. What will be the output of the given code?
counter = true while counter !=false puts counter end
V
Q. What will be the output of the given code?
while a&&b puts a end
V
Q. What will be the output of the given code?
a=1 b=1 while a&&b puts a+b end
V
Q. What will be the output of the given code?
i = 4 while i > 0 do print i i -= 1 end
Don't have account? Register here.