+ 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?
5 Answers
+ 14
When you wanna do something before checking the condition.
+ 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
+ 2
code that needs to execute a code block at least once but you dont know if it has to run again.
0
If you want to run the code once before checking the condition.