When you know exactly how many times you want to loop through a block of code, use the for loop instead of a while loop.
for (statement 1; statement 2; statement 3) {
// code block to be executed
}
for (int i = 0; i < 5; i++) {
cout << i << "\n";
}
For loops are the best choice for iterating over arrays and strict counting tasks.
In a for loop syntax for (statement 1; statement 2; statement 3), what does statement 2 typically define?