Check what you learned about for loops and ++.
for
++
1. What does for (int i = 0; i < 3; ++i) { std::cout << i; } print?
for (int i = 0; i < 3; ++i) { std::cout << i; }
01
0123
123
012
2. In for (A; B; C), which part runs only once, before the loop starts?
for (A; B; C)
C
A
B
3. What does int x = 5; std::cout << x++; print?
int x = 5; std::cout << x++;
6
5
4. What does int x = 5; std::cout << ++x; print?
int x = 5; std::cout << ++x;
5. How many times does for (int i = 10; i > 0; i -= 2) run its body?
for (int i = 10; i > 0; i -= 2)
6. In a for loop, does the step part (like ++i) still run after continue?
++i
continue