Architecture Diagram
for (init; condition; increment) {
statement1;
if (skip) continue; ───┐ (Jump directly to increment step)
statement2; │
} ▼
increment -> conditionfor (init; condition; increment) {
statement1;
if (skip) continue; ───┐ (Jump directly to increment step)
statement2; │
} ▼
increment -> condition#include <iostream>
int main() {
std::cout << "Printing odd numbers between 1 and 10:
";
for (int i = 1; i <= 10; ++i) {
// Skip even numbers
if (i % 2 == 0) {
continue; // Skip the rest of the loop body
}
std::cout << i << " ";
}
std::cout << "
";
return 0;
}continue as an early guard check at the top of loops to avoid deeply nested if statements.while loops are incremented before invoking continue to avoid infinite loops.