Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

Wich is the diference between a "while" and a "do while" ?

OpenStudy (amistre64):

which is the difference? as in there are options to choose from?

OpenStudy (amistre64):

A while statement considers the arguement before executing. Do-while; executes the statement "at least once" before considering the arguement. "While" is thoughtful and will do as it is told; "Do-While" acts without thinking and is impulsive :)

OpenStudy (anonymous):

while ->Loop when condition is true and n times,=>entry level condition check.no guarntee to run. do ->enter and check the condition and run n times =>exit level condition check.atleast once loop body executed.

OpenStudy (anonymous):

Essentially it is the difference between: while (condition) do_something V/S do_something while (condition) In the first case, the condition gets checked first then "do_something" happens. In the second case, "do_something" happens at least once before the condition gets checked. And thats all there is to it!

OpenStudy (anonymous):

"do while" is exit check loop which checks the condition only at the end... so the condition is executed at least once even though the condition is not satisfied. "while" is entry check loop and only if the given condition is true the loop will be executed.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Breathless: Spooky witch but cute
4 hours ago 3 Replies 0 Medals
Arriyanalol: help
4 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
7 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
7 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!