C++ break statement

Break statement is usually used to terminate a case in the switch statement. Break statement in loops to instantly terminates the loop and program control goes to the next statement after the loop.
If the break statement is used in nested loops (i.e., loop within another loop), the break statement will end the execution of the inner loop and Program control goes back to the outer loop.

Syntax

Example

Output

1 thought on “C++ break statement”

Comments are closed.