C break statement
The break is a keyword in C that is used to bring the program control out of the loop. The break statement is used inside loops or switch statements. The break statement breaks the loop one by one, i.e., in the case of nested loops, it breaks the inner loop first and then proceeds to outer loops. The break statement in C can be used in the following two scenarios:
- With switch case
- With loop
Syntax:
Flowchart of break in c
Example
Output
0 1 2 3 4 5 came outside of loop i = 5