Vidyalelo
Ruby Programming · Q14

Control Structures in Ruby

Programming · Ruby Programming · question 14

Q14

What is the output of the following code snippet? x = 5 while x > 0 puts x x -= 1 end

A.
54321
B.
12345
Answer
C.
Error
D.
Infinite loop

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board