While Loop |
|
The while loop loops through a block of code while a specified condition is true.
There are two special statements that can be used inside loops: break and continue .
The break statement will break the loop and continue executing the code that follows after the loop (if any).
|
|
Do ... While Loop |
|
The do ... while loop is a variant of the while loop.
This loop will execute the block of code once, and then it will repeat the loop as long as the specified condition is true.
The continue statement will break the current loop and continue with the next value.
|
|