Control Structures In Ruby - Study Mode
[#66] What is the output of the given code? i = 3
while i > 0 do
print i
i -= 1
end
Correct Answer
(B) 321
[#67] What is the output of the given code? i = 50
while i > 25 do
print 50/i
i -= 1
end
Correct Answer
(D) 1111111111111111111111111
[#68] What is the output of the given code? a = 5
b=10
while a<b do
puts a*b
a+=2
b-=2
end
Correct Answer
(B) 50 56
[#69] What is the output of the given code? i = 50
j=55
while i > 25 && j>35 do
puts 50*j/i
i -= 1
j-=2
end
Correct Answer
(B) 50 55
[#70] What is the output of the given code? i = 50
j=55
while i > 25 && i*j<100 do
puts (50*j)/i
i -= 1
j-=2
end
Correct Answer
(B) No output