can someone explain this please. My name is jade and i've been defeated | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can someone explain this please. My name is jade and i've been defeated

Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop checks its condition at the bottom of the loop. A do...while loop is similar to a while loop. The one difference is that the do...while loop is guaranteed to execute at least one time.

18th Jan 2017, 8:30 PM
Jade-leroy
Jade-leroy - avatar
2 Answers
+ 1
do{ // do something <--- this block runs through }while( /*condition*/); // <--- then checks the first time whether the condition is true while( /*condition*/){ // Checks the condition first // do something <--- if the condition is true } for( /*counter*/;/* condition */; /* do after loop iteration */){ // checks condition first // do something <--- if the condition is true }
18th Jan 2017, 8:40 PM
Andreas K
Andreas K - avatar
0
0_0 damn thanx bro!!!
18th Jan 2017, 8:56 PM
Jade-leroy
Jade-leroy - avatar