Cpp Control Flow Statements 19

Break and continue statements

Break Continue
On execution of break statement the control jumps out of the loop. On execution of continue statement the control jumps to the beginning of the loop.

Syntax:

{
—-
—-
if (condition)
break;
—–
—–
}

Syntax:

{
—-
—-
if (condition)
continue;
—–
—–
}

The break statement can be used with for loop, while loop , do while loop and switch statement. The continue statement can be used with for loop, while loop , do while loop.