Using the code:
create("a")
0 -> a
while(a < 10)
if(a % 2 = 0)
printline(a)
otherwise
printline("odd")
endif
a + 1 -> a
endwhile a + 1 -> a
At first the if statement caused a few problems at the otherwise statement was executing twice, but after a bit of tweaking with the code, I got my result, the IDE printed all the even numbers.
No comments:
Post a Comment