First page Back Continue Last page Graphics
Update – Expression
Evaluated AFTER the loop body has been executed.
Normally used to change the loop control variable.
Can produce an infinite loop!!!
- for (int i=0; i<10; i--) cout << “xxx” << endl;
Does not have to increment or only increment by 1.
Can decrement, and increment by any amount.
Practice: loop2.cpp in inclass