Loops & iterators in ruby


looping with while

numbers 1 to 50 are not printing out inclusively

Replace this line with your code. 
while i > 0
print i
 i -= 1


I believe you need to change your 0 to a 1, otherwise the loop stops at zero, instead of one.


Change the order from 50 to 1, to 1 to 50.

Disregard the above advice in the earlier reply.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.