The do/while repetition structure is similar to the while structure.
The do/while tests the loop-continuation condition after the loop body is performed.
Consequently, its loop body always is performed at least once.
A comparison of the flow chart representation makes this clear.
Braces should always be used in the do/while (even when they are not grammatically necessary), making it
clear that we are ending a do/while structure, not beginning a while structure.
For example,
do
sum += a*b;
while ( n <= limit );
isn't as clear as the same code in braces:
do {
sum += a*b;
} while ( n <= limit );
Always put a semicolon after the loop-continuation condition of a do/while.
Never put a semicolon after the loop-continuation condition of a while (unless the while loop is empty :).