CH04 : Control Statement in C
Two types of Control Statement
:
- if-else statement
- switch statement
If-else statement
### `If-else` :If-else statement is used to execute a statement block or a single statement depending on the value of a condition.
**syntax** : ```c if (condition) { ------------Nested if-else statement
### nested if-else statementAn if statement may have another if statement in the `true block` and `false block`.This compound statement is called nested if statement.
**syntax** : ```c if (condition 1) { if (condition 2) { -------------- <true block 1> -------------- } else { ------------- <false block 1> ------------- } } else { if (condition 3) { -------------- <true block 2> -------------- } else { --------------- <false block 2> --------------- } } ```Switch Statement
### switch statementswitch statement is used to create a block of statements depending on the value of a variable or an expression.
**syntax** : ```c switch (