The syntax is for (init; condition; update) { /* body */ }. Three parts separated by semicolons control how the loop runs from start to finish. Init runs once before the loop starts.
Condition is checked before each iteration. Update runs after each iteration body completes before the next check. Example: for (int i = 0; i < 3; i++) { cout << i; } prints 0, 1, 2.
Init sets i to 0, condition checks i < 3, update increments i after each pass.