+ 4

when do we use a do while loop?

what kind of programs need a do while loop and cant we use a for loop instead?

7th Nov 2017, 5:44 AM
Leoulg
Leoulg - avatar
5 Answers
+ 14
When you wanna do something before checking the condition.
7th Nov 2017, 7:07 AM
qwerty
qwerty - avatar
+ 6
When you wanna do something then check use do-while If you wanna use for loop, it's a while loop in disguise, meaning you check a condition before doing something
7th Nov 2017, 6:23 AM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar
+ 2
code that needs to execute a code block at least once but you dont know if it has to run again.
7th Nov 2017, 9:20 AM
Jeremy
Jeremy - avatar
0
If you want to run the code once before checking the condition.
24th Jan 2018, 10:15 PM
Purpll
Purpll - avatar