Break immediately exits the loop, skipping all remaining iterations. Execution continues with the first statement after the loop closing brace. You use break when you find what you are searching for or encounter an error condition.
The loop stops even if the condition is still true. Break only exits the innermost loop. If you have nested loops, break exits the loop containing the break statement but does not affect outer loops.