Leave a loop early, or skip the rest of one round.

In this video:

  • break; leaves the loop right away, for example once the sum is greater than 100
  • The code after the loop runs next
  • continue; skips the rest of this round and goes on to the next one
  • Skipping input you don't want, with a message for the user
  • In a while loop, continue also skips the counter update at the end of the round, so the skipped value doesn't count