Jumps: Theory

Standard Input/Output
  • The break statement

    • The break statement can appear in the switch statement and the loop statement
      • It cause the execution of the current enclosing switch case or the loop to terminate
      • When it is encountered, all the rest of the codes after the break inside the code block are skipped
      • General syntax: break;
  • The continue statement

    • The break statement can appear in the switch statement and the loop statement
      • It’s used to terminate the current iteration only
      • It skips the rest of the statements in the body of the loop and begins next iteration
      • General syntax: continue;