Syntax: do { code; } while (condition);
Explanation
do .. while loops is similar to while, the only difference being that the block of code is executed at least once, before checking if the condition is TRUE.
Just like a while loop, you can end the loop's excution by using break, return and making the condition FALSE
Example
temp.counter = 10; do { temp.counter++ } while (temp.counter < 10);
temp.counter will increase only by one in this loop, because the condition is false. However, this differs from a while loop in that the code block would not be executed at all.
There are no comments on this page. [Add comment]