Till now we have seen different conditional constructs and loop construct such as if...else, while, for, switch and do statements. Now, we will study break, continue and exit statements which are used to alter the normal flow of program. A loop performs a set of repetitive tasks until the conditional-expression becomes false, but sometimes it is desirable to skip some action statements inside the loop or terminate the loop immediately without checking the conditional-expression. In such cases, break and continue statements are used.
Statements affecting flow control
Break usage
The break statement is used to terminate the innermost while, do...while, or for loop that encloses it. The break statement is also used to break out...