ABSTRACT

In all of the example programs in the preceding chapters, the ow of execution has been sequential-the rst statement of main() is executed, then the second statement, and so on until the last statement has been executed and the closing curly brace } reached. e following flow diagram shows this straight-line pattern of execution that

CONTENTS 5.1 Introductory Example: Air Quality Index (AQI) 108 5.2 Boolean Expressions 111 5.3 Example: Digital Circuits-A Binary Half-Adder 118 5.4 Selection: e if Statement 121 5.5 Repetition: e for and while Statements 127 Chapter Summary 134 Test Yourself 136 Exercises 139 Programming Problems 143

characterizes sequential execution and indicates clearly that the statements are executed in the order in which they are given with each statement being executed exactly once.