Home / Questions / What is the difference between a break statement and a continue statement when they occur in a loop?
Explanatory Question

What is the difference between a break statement and a continue statement when they occur in a loop?

👁 94 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

When the break statement gets executed, it terminates its loop completely and control reaches to the statement immediately following the loop. The continue statement terminates only the current iteration of the loop by skipping rest of the statements in the body of the loop.