Terminate execution of for or while loop
break
terminates the execution of afor
orwhile
loop. Statements in the loop after thebreak
statement do not execute.
In nested loops,break
exits only from the loop in which it occurs. Control passes to the statement that follows theend
of that loop.