Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The break and continue statements alter the flow of control. The break statement, when executed in a while, for, do...while or switch statement, causes immediate exit from the statement. Execution continues with the first statement after the structure. The break statement is commonly used to escape early from a loop or to skip the remainder of a switch statement (as in Fig. 6.7). Figure 6.11 demonstrates the break statement in a for repetition statement.