C++ Break

tutorial and example
tutorial and example

C++ break Statement

The break statement is used to alter the normal flow of a program. The break statement terminates a loop (for, while and do..while) and switch statement instantly where it applied.

When break statement is applied inside nested loop, it only affects (breaks) the inner loop.

Syntax

C++ break Example

Output: