Loops & iterators in ruby


#1


looping with while

numbers 1 to 50 are not printing out inclusively


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


#2

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


#3

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

Disregard the above advice in the earlier reply.


#4

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