Need help on " Looping with until"


#1

exercise 15.

what wrong with it?

j = 1
until j == 50 do
print j
j += 1
end


#2

@levelworld,

Remember that the exercise wants you to count up from 1 to 50 inclusive. The following code worked for me:

i = 1
until i == 51 do
print i
i += 1
end

http://stackoverflow.com/questions/16701861/ruby-why-use-until-when-while-can-do-the-same

http://stackoverflow.com/questions/190590/does-ruby-have-a-built-in-do-while

http://stackoverflow.com/questions/136793/is-there-a-do-while-loop-in-ruby?lq=1


#3

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