L
Logan Lee
Hi. What's the difference between while and do while?
Logan said:Hi. What's the difference between while and do while?
Logan Lee said:Hi. What's the difference between while and do while?
Logan said:Hi. What's the difference between while and do while?
Logan Lee said:Hi. What's the difference between while and do while?
A do while is used for a block of code that must be executed at least once.
These situations tend to be relatively rare, thus the simple while is more
commonly used.
Kenny said:The best way to express this is that:
do {<statement>} while (<expr>);
is equivalent to:
{};
while () do {};
i.e., do it once, then enter into a normal "while" loop.
{};
while () do {};
Logan said:Hi. What's the difference between while and do while?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.