138k views
23 votes
A program has a infinite while loop. How can you interrupt it?

User Per Huss
by
3.6k points

1 Answer

11 votes

Answer:

The break keyword is how you interrupt a while loop.

the syntax looks like this ↓

Python

while true:

break

Java script

while (true);

break

User Jaleh
by
3.2k points