The Jump Statements break and continue
The following section discusses how the break and continue statements can be used to influence the flow of execution during the execution of a loop statement.
The break Statement
Occasionally programmers want to terminate a loop somewhere inside its loop body rather than at the beginning or at the end of the loop. They can achieve this by using the break statement that was introduced along with the switch statement in the previous chapter.
The break Statement and the Iteration Statements
The break statement can be used to terminate an iteration statement and will, when executed, cause the flow of control to ... |
Get C# Primer Plus now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.