What are break and continue statements

Posted by Andre Scott | Updated on

The break statement is used to “jump out” of a loop. i.e, It breaks the loop and continues executing the code after the loop.

The continue statement is used to “jump over” one iteration in the loop. i.e, It breaks one iteration (in the loop), if a specified condition occurs, and continues with the next iteration in the loop.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers