Programming in C: Unit I (c): Decision Control and Looping Statements

Introduction to Decision Control Statements

Programming in C

Till now we know that the code in a C program is executed sequentially from the first line of the program to its last line, i.e., the second statement is executed after the first, the third statement is executed after the second, and so on.

Unit – I : Basics of C Programming

CHAPTER 3 : DECISION CONTROL AND LOOPING STATEMENTS

Takeaways

• Decision control statements

• For, while, Do-while loops

• Conditional branching statements

• Nested loops

• Iterative statements

• Break, continue, and goto statements

INTRODUCTION TO DECISION CONTROL STATEMENTS

Till now we know that the code in a C program is executed sequentially from the first line of the program to its last line, i.e., the second statement is executed after the first, the third statement is executed after the second, and so on.

Although this is true, but in some cases we want only selected statements to be executed. Such type of conditional processing extends the usefulness of programs. It allows the programmers to build programs that determine which edr statements of the code should be executed and which should be ignored.

C supports two types of decision control statements that can alter the flow of a sequence of instructions. These include conditional type branching and unconditional type branching. Figure 3.1 shows the categorization of decision control statements in C language.

Programming in C: Unit I (c): Decision Control and Looping Statements : Tag: : Programming in C - Introduction to Decision Control Statements