Break Statement in C++ Language
Break statement is used to break a loop or switch statement. It breaks the current flow of the program in the given condition. In the case of inner loop, it only breaks the inner loop.
Syntax -
Flowchart -
Break Statement Example -
Let's look at a simple example of a break statement that is used inside a loop.
Output -
12
34
Break Statement with Inner Loop
The break statement breaks the inner loop only when you use the break statement inside the inner loop.
Let's look at example code -
Output -
1 11 2
2 11 3 3 13 33 2