Compile error 18 to 0 use next if


in the loop&iterators --> next !
i type the code:
for i in 0..18
next if i %2 == 1
print i

the error: it's look like it didn't print out the numbers 18 to 0
why error come out??


Hello. From what I see, what's wrong in your code is that the question he asks to print only the couple, and you put your situation "if" doing the opposite. Try to change that part or follow the instructions below if you have questions about:

i = 20
loop do
i -= 1
next if i % 2 != 0
print "#{i}"
break if i <= 0

I hope this helps and good luck.


Thanks a lot!
its work !!!