Lecture 14: Loops 4Tuesday, October 18, 2011 Status: complete
[Up] [Previous Lecture] [Next Lecture]
Reading Assigned: 5.8
Homework Due: Homework 6
Homework Assigned: Homework 7
- Dangling else and nested if statements.
- Switch statements
- Miscellaneous C language features that we've missed.
- Discuss Homework 7 & 8.
- Dangling else clause in nested if statements: dangle1.c and dangle2.c.
- Better indentation scheme for cascading if statements: nested.c
- Switch statement examples: switch1.c, switch2.c and switch3.c.
- DeMorgan's Law: demorgan.c.
- Assignments are expressions too: assign.c.
- Using a flag to control a while loop (or what do we do if our instructor won't let us use break inside a while loop?): nobreak1.c and nobreak2.c.