C Decision Making
• Conditional/Decision making statements in C programming are
used to make decisions based on the conditions.
• There are the following variants of if statement in C language.
If statement
If-else statement
If else-if ladder
Nested if
C Decision Making
C Switch Statement
• The switch statement in C is an alternate to if-else-if ladder
statement which allows us to execute multiple operations for the
different possible values of a single variable called switch
variable.
C Switch Statement
• Rules for switch statement in C language:
The switch expression must be of an integer or character type.
The case value must be an integer or character constant.
The case value can be used only inside the switch statement.
The break statement in switch case is optional. If there is no
break statement, then all the cases will be executed after the matched case.