A continue statement skips the remaining statements in a loop's compound statement for the current iteration. Control then reevaluates the loop condition and, when true, begins the next iteration. section 3.2
for (size_t i =0; i < max_iterations; ++i) {
if (x > 1.0) { // Checks if we are on the correct side of 1
x = 1.0/x;
continue;
}
double prod = a*x;
if (fabs(1.0 - prod) < ε) { // Stops if close enough
break;
}
x *= (2.0 - prod); // Heron approximation
}
This loop uses continue to handle values greater than 1 before computing the product; the skipped statements do not run for that iteration. section 3.2
TAKEAWAY:
- Use continue to separate an iteration-specific case from the main loop computation. section 3.2
- Unlike break, continue does not stop the loop; it proceeds through condition reevaluation. section 3.2




