break statement

From cppreference.com
< c‎ | language

Causes the enclosing for, while or do-while loop or switch statement to terminate.

Used when it is otherwise awkward to terminate the loop using the condition expression and conditional statements.

Syntax

break ;

Appears only within the statement of a loop body (while, do, for) or within the statement of a switch.

Explanation

After this statement the control is transferred to the statement or declaration immediately following the enclosing loop or switch, as if by goto.

Keywords

break

Notes

A break statement cannot be used to break out of multiple nested loops. The goto statement may be used for this purpose.