+ 2

What is the difference between while and do while?

16th Jan 2018, 2:36 PM
saichowdary pamidi
saichowdary pamidi - avatar
4 Answers
+ 1
do-while runs once. before it checks the condition. while first checks then runs
16th Jan 2018, 2:39 PM
Andreas K
Andreas K - avatar
+ 3
"while "checks the condition first and then if its true executes the given code,,,,, "dowhile" executes the given code once and checks the condition at the end and continues if its true,,,,
16th Jan 2018, 2:47 PM
Rohan K M
Rohan K M - avatar
+ 2
while executes the loop provided that conditions are true! do while executes the code not regarding the value of the conditions first..then proceeds to execute repeatedly if conditions are true
16th Jan 2018, 3:04 PM
᠌᠌Code X
᠌᠌Code X - avatar