Explore BrainMass

Explore BrainMass

    Break and Continue Statement: Infinite Loop Situation

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    What's the difference between break and continue statement? How will it help the infinite loop situation?

    © BrainMass Inc. brainmass.com October 9, 2019, 11:08 pm ad1c9bdddf

    Solution Preview

    Please find the solution described below.

    There is a huge difference between break and continue statement.

    "break" is used to break a current executing statement, like a for loop, switch statement etc. That is break helps to come out of the loop.

    Both the keywords are generally used in switch statement or inside the loop.

    "continue" is used to transfer control to beginning of the loop, and skips the rest of the ...

    Solution Summary

    Described is the difference between break and continue statement and how it will help the infinite loop situation.