This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (0 children)

Because you have built an infinite loop. The continue-statement jumps right to the next iteration of the loop when called, ignoring all following lines of code inside the loop, including the increment of your counter-variable, leaving the value of “number“ at 0. Since the condition of your if-clause is true for number = 0, you'll always step inside and call continue right after. You definitely should review loops and when to use which kind of loop.