Break and Continue Statement

Break Statement


By using this jumping statement, we can terminate the further execution of the program and transfer the control to the end of any immediate loop or switch body.

 To do all this we have to specify a break jumping statements whenever we want to terminate from the loop.


Syntax: break;


NOTE: This jumping statements always used with the control structure like switch case, while, do while, for loop etc. NOTE: As break jumping statements ends/terminate loop of one level . so it is refered to use return or goto  jumping statements , during more deeply nested loops. 

Continue Statement


By using this jumping statement, we can terminate the further execution of the program and transfer the control to the beginning of any immediate loop.
To do all this we have to specify a continue jumping statements whenever we want to terminate any particular condition and restart/continue our execution.

Syntax: continue;

NOTE: This jumping statements always used with the looping structure while, do while, for loop .