A do statement repeats a body while its controlling condition is true, but tests that condition after the body runs. Therefore, the body executes at least once. section 3.0 section 3.2
while (condition) secondary-block do secondary-block while(condition);
Compare the preconditioned while form with the postconditioned do form: do places the condition after the secondary block and ends the statement with a semicolon. section 3.2
Repeat an approximation until it is close enough
do { x *= (2.0 - a*x); } while (fabs(1.0 - a*x) >= ε);
This form suits an operation that must happen before its stopping test. In the approximation, each iteration updates x, then checks whether a*x is close enough to 1.0.
TAKEAWAY rules:
- Use do when the first execution is required; use while when the condition must be checked before entering the body. section 3.2
- Treat 0 as false and every other numerical value as true when evaluating the controlling condition. section 3.4
- Prefer structured control flow, while recognizing that loops add control-flow paths a reader must track. section 19.0

