break statement in c

The keyword break allows the programmers to terminate the loop. The break skips from the loop or block in which it is defined.

The control then automatically goes to the first statement after the loop or block. The break can be associated with all conditional statements.

We can also use break statements in the nested loops. If we use break statement in the innermost loop, then the control of the program is terminated only from the innermost loop.

The break statement causes an immediate exit from a loop. Because the code that follows it in the loop is not executed if the break is reached, you can also sometimes avoid nesting by including a break.

It is possible to force an immediate exit from a loop, bypassing the loop’s conditional test, by using the break statement.