The
break statement transfers control to the next statement following the loop (
for or
while statement) that encloses the
break statement. A
break statement can only be used within a
for or
while statement. Any statements between the
break statement and the end of the block are not executed. For more information, see
Defining loops.