Objectives
In this appendix you’ll:
Learn basic problem-solving techniques.
Develop algorithms through the process of top-down, stepwise refinement.
Use the if
and if
...else
selection statements to choose among alternative actions.
Use the while
repetition statement to execute statements in a program repeatedly.
Use counter-controlled repetition and sentinel-controlled repetition.
Use the compound assignment, increment and decrement operators.
Learn the essentials of counter-controlled repetition.
Use the for
and do
...while
repetition statements to execute statements in a program repeatedly.
Implement multiple selection using the switch
statement.
Use the break
and continue
statements.
Use the logical operators in conditional expressions.
C.5 if
Single-Selection Statement
C.6 if
...else
Double-Selection Statement
C.7 while
Repetition Statement
C.8 Case Study: Counter-Controlled Repetition
C.9 Case Study: Sentinel-Controlled Repetition
C.10 Case Study: Nested Control Statements
C.11 Compound Assignment Operators
C.12 Increment and Decrement Operators
C.14 Essentials of Counter-Controlled Repetition
C.16 Examples Using the for
Statement
C.17 do
...while
Repetition Statement
C.18 switch
Multiple-Selection Statement
C.19 break
and continue
Statements
Self-Review Exercises | Answers to Self-Review Exercises | Exercises