while-Loops

Mit while- bzw. do while-Loops können wir einen Codeblock so lange wiederholen, bis eine bestimmte Bedingung erfüllt ist.

while-Loop

while (condition) 
{
    
}

do while-Loop

do 
{
    
}
while (condition);

Im Gegensatz zum while-Loop läuft der do while-Loop mindestens einmal durch.

Zuletzt aktualisiert

War das hilfreich?