Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 396 Bytes

File metadata and controls

45 lines (32 loc) · 396 Bytes

Loops

  • while
  • for
  • do while

while Loop

while(condition) {
    // do something
}

for Loop

for(initialisation; condition; updation) {
    // do something
}

do while Loop

do {
    // do something
} while(condition);

break Statement

To exit the loop

break;

continue Statement

To skip an iteration

continue;