0
While loop
When does an infinite loop occur in while loop?
1 Answer
+ 6
Basically an infinite loop occurs when the condition tested for in the while is always true.
Let's look at Jay's examples:
true is always true so your loop goes on forever
x = 0 and never gets changed so the condition x < 10 is always true so again, your loop goes on forever