Search This Blog

If you like any posts in this blog then click this icon which is present under the post

Thursday 11 August 2011

Break Statement - Jumping out of a loop


                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
                                               
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

Followers