While and do while

Published by Mario Oettler on

Last Updated on 23. March 2023 by Martin Schuster

while

A while loop evaluates the condition at the beginning. As long as it yields true, the loop is repeated.

while (repeat == true) {
    // repeat as long as repeat is true.
}

do while

In a do while loop the statements are executed at least once. The condition is checked at the end.

 do {
   // execute at least once
   // repeat if the condition is true
} while (condition);
Categories:

https://blockchain-academy.hs-mittweida.de/wp-content/uploads/2021/04/logo_bcam_rgb_gross.png

Welcome

Blockchain Academy

Continue with credential

No account yet?

Powered by Hidy

Register with Hidy


Register
Sign in

We need the following credential to register:

please select:

To create a new account, we need the following data from you:

We would appreciate the following additional information from you for the creation of your account:

Welcome

Blockchain Academy

Continue with credential

Already have an account?

Powered by Hidy

Sign in with Hidy


Register
Sign in

We need the following credential to log in:

please select: