break break Statementbreak;
The break statement terminates the execution of the innermost
enclosing do, for, while or switch statement. Control is then
transferred to the statement following the terminated loop.
Notes: If the break keyword appears in any other context, a
syntax error is generated.
`Break' terminates only the innermost loop. To leave an
outer loop from within an inner (nested) loop, you can
use the return or (shudder) goto statements.
There is distinct difference between the effects of
`break' and `continue': `break' actually exits the loop,
whereas continue skips the remainder of the body, and
then continues the loop with the next iteration.
-------------------------------- Example ---------------------------------
while (1) {
if (condition)
break;
...
}
next-statement;