The break keyword is used to prematurely exit a for, while, or do loop or to mark the end of a case block in a switch statement.
for (i=0; i<max; i++)
{
if (<loop finished early>)
{
break;
}
}
int type = <some value>; switch (type) { case 1: <statement> break; case 2: <statement> break; default: <statement> }
break always exits the innermost enclosing while, for, do or switch statement.