Lecture 13: Loops 3Thursday, October 13, 2011 Status: complete
[Up] [Previous Lecture] [Next Lecture]
Powerpoint Slides: none
Reading Assigned: 5.7
- for loops
- increment and decrement operators: ++, --
- shortcut assignment operators: +=, -=, ...
- Classwork 13.
- Simple uses of a for loop: for1.c, for2.c and for3.c.
- Don't use a for loop with floating point variables as the control: beer.c.
- Using the increment and decrement operators (++, --) and the shortcut assignment operators (+=, -=, ...): ops1.c, ops2.c and ops3.c.
- Revisiting the inchworm from
Here's the original program to eat a food pellet: eat.c.