[ad_1]
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();
}
[ad_2]
solved What is the purpose of a do-while loop? [duplicate]