Break statement is used to exit from a loop while the test condition is true. This statement can be used within a for, while, do-while or switch statement.
The general form is
The general form is
break; |
When the break statement is executed inside a loop, the execution of the loop is terminated and the program continues with the statement following the loop. If break statement is used in nested loops, it will exit from the loop containing it.
No comments:
Post a Comment