 Here's the flowchart for an ordinary while loop. Sometimes you want to break out of a loop before the condition becomes false. You use a break statement to do that. Here's an example of a program that finds the smallest factor of an integer. I've highlighted the while loop with its break statement. Let's take a closer look at how this while loop works. Presuming that the user has entered 21 as their number, we start factor as 2. Our while condition tests if 2 is less than or equal to 21. It is, and that means we enter the loop. We then check to see if 21 is divisible by 2. It isn't, so we increment factor. We come back to the condition. 3 is less than or equal to 21. 21 is divisible by 3. That ends our loop, and the correct answer is that the smallest factor of 21 is 3. Some people don't like to use break as it provides a second exit point from our loop. The first exit point is the condition, the second one being the break. If I see something like this in your programs with while true, I get very suspicious that you haven't thought through your conditions. There are two ways to get around needing break. One is to set a Boolean flag as we have in this program. On line 18, I set a Boolean named found to false. Our loop condition changes. While we haven't reached n as a factor and we still haven't found the smallest factor, we test to see if n mod factor equals zero, if it's divisible. If so, we set found to true. Otherwise, we go on to the next factor. At some point, we will find something that's divisible, found will be true, and this compound condition will come out to false, and will exit the loop from the condition. The book says that this is much less readable than break. However, we can go one step further and eliminate both the break and our Boolean flag. In this version of the program, we put our test for divisibility into the while loop condition. As long as the factor is less than or equal to n and it doesn't divide it evenly, we move on to the next number. Pulling the break condition into the while condition takes extra thought and planning, but it's well worth it. The other concept that I want to touch on very briefly is continue. Continue jumps to the end of the loop and starts the next iteration. It doesn't exit the loop. This is not as commonly used as break. You can almost always use an if statement to get the same effect. Here's a program that uses continue. The program counts from 1 up to 10, skipping over 7 and 8. Let's run the program, and you'll see that it does exactly that. In summary, though you will very seldom need a continue to skip over part of a loop iteration, you'll more often see break used to provide an extra exit from a loop, though you should use it carefully and only when absolutely necessary.