- Selection Statement (Branching Statements) if-else, switch-case
- Iteration Statement (Looping Statements) for, while, do-while
1. Selective Structure (Branching Statement)
The selection statements allow to choose the set-of-instructions for execution depending upon an expression's truth value. C provides two types of selection statement: if and switch. In addition in certain circumstance ? : (Ternary) Operator can be used as an alternative to if statement. The selection statements are also called as conditional statements or decision making statement, because it helps in making decision about which set-of-statements is to be executed.
List of Selection Statements are:
- if-else Statement
- if-else-if Statement
- Nested if-else Statement
- switch-case Statement
- goto Statement
2. Iteration Statement (Looping Statement)
The iteration statement allows a set of instructions to be performed repeatedly until a certain condition is fulfilled. The iteration statements are also called as loops or looping statements. C provides three kinds of loops: for loop, while loop, and do-while loop.All three looping statements of C repeat a set of statements as long as a specified condition remains true. This specified condition is generally referred to as a loop control. For all three loop statements, a true condition is any nonzero value. A zero value indicates a false condition.
List of Iteration (Looping) Statements are:
0 comments:
Post a Comment