So what is the difference between do and do...while loops? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

So what is the difference between do and do...while loops?

4th Feb 2018, 6:27 PM
PizzaOwl
PizzaOwl - avatar
2 Respostas
+ 14
do while() , while () /*in do while() , condition is checked after executing the statements , while in while () loop , condition is checked before execution of the statement(s)*/
4th Feb 2018, 7:14 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 8
do whileĀ in an exit controlĀ loop.Ā whileĀ is an entry controlĀ loop. TheĀ differenceĀ is in when the condition gets evaluated. ...Ā Do while loopwill be executed atleast once.......butĀ while loopĀ will check the condition first and then it may or may not get executed depending on the condition. https://stackoverflow.com/questions/3625759/difference-between-while-loop-and-do-while-loop
4th Feb 2018, 7:08 PM
GAWEN STEASY
GAWEN STEASY - avatar