Feed Headline Animator

Explain Continue & Break statement

Continue statement: -

The “continue” statement shifts the control break to the beginning of the loop. It is used inside the body of a loop. When this statement is executed inside the body of loop, the control shift to the first statement of the body of the loop and the statement within the body of loop following the continue statement are not executed. Its syntax will be as:
Continue;

Break statement: -

The “break” statement is used to terminate execution of a loop when it is used inside the body of the loop.

Different between continue and break statement:

The “break” statement terminates the loop during execution. The other statements of the body of the loop that come under the “break” statement are not executed.

The “continue” statement does not terminate the loop but it shifts the control at the beginning of the body of the loop. The statements of the body of the loop that come under the “continue” statement are not executed.


Posted by: Wasim Javed

No comments:

Post a Comment