[Solved] What is the purpose of a do-while loop? [duplicate]


Consider the following:

while(condition){
   myFunction();
}

and

do{
   myFunction();
}while(condition);

The second form executes myFunction() at least once then checks the condition! To do so with a while loop you’ve to write:

myFunction();

while(condition){
   myFunction();
}

solved What is the purpose of a do-while loop? [duplicate]