Even green-bean programmers know the difficulty that a “while loop” presents. But if you don’t know how many times the block of code should be executed a while loop can be a great choice.
The while loop repeats a statement until the test at the top proves false.
while (Terrorist)
{
makeWar;
}
There are two problems in this.
While loops are easy to enter, and if they aren’t thoughtfully designed they lead to infinite loops.
only an exit() will break.

You must be logged in to post a comment.