Ruby - Loops and Iteration
Identify the error in this Ruby code using an
until loop:
i = 0 until i < 5 puts i i += 1 end
until loop:
i = 0 until i < 5 puts i i += 1 end
until i < 5 with i=0: 0 < 5 is true, so condition true and loop never executes.until i > 4 or similar. The loop condition should be > instead of < identifies this.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions