In order to understand conditional statements, first we need to understand conditions.In C, conditions are logical statements whose final value will be either true(it is generally represented as integer 1 or any non-zero integer ) or false(it is represented as 0)
In logical statements, we need to use logical operators.Some of the logical operators are:
· ==
(if L.H.S and R.H.S are equal then this operator returns true(1) else returns false(0))Example: (2+1)==3 returns true and 2==3 returns false
· <
(if L.H.S is less than R.H.S then this operator returns true(1) else returns false(0))Example: 2<3 returns true and 5<4 returns false
· >
(if L.H.S greater than R.H.S then this operator returns true(1) else returns false(0))Example: 3>2 returns true and 2>8 returns false
· <=
(if L.H.S less than or equals to R.H.S then this operator returns true(1) else returns false(0))Example: 2<=3 returns true and 4<=3 returns false
· >=
(if L.H.S greater than or equals to R.H.S then this operator returns true(1) else returns false(0))Example: 4>=3 returns true and 6>=10 returns false
· !=
(if L.H.S and R.H.S are not equal then this operator returns true(1) else returns false(0))Example: 2!=3 returns true and (2+4)!=(3+3) returns false
In C, conditional statements are implemented through if-else statements.

Syntax :
if(condition-A){
Statements-A;
}
else if(Condition-B)
{
Statements-B;
}
else{
Statements-C;
}
Example:
Code:

Output:

We use conditional statements to direct the direction of flow of control of our program into respective parts of the program by using some respective conditions.
When the flow of control reaches ‘if – else’ block, first it will check the condition that is present inside the parenthesis of ‘if’ block. If the condition evaluates to be true then the flow of control will go inside the ‘if’ block and execute the statements in it. After that flow of control skips all the else-if blocks and final else block and continues with the rest of the program.If the ‘if ’condition evaluates to be false then compiler will check the next else-if block condition. If else-if block condition is true then those statements present in else-if block will be executed. If the else-if condition is false then compiler will check for the next else-if condition if it is present.
When ‘if’ condition and all the else-if conditions are false then the statements inside the ‘else’ block are executed.
Note: we can use multiple ‘else-if’ blocks corresponding to one ‘if’ block but we can use only one ‘else’ block corresponding to one ‘if’ block. Using ‘else-if’ and ‘else’ blocks without any preceding ‘if’ block is an error. We can also use nested if-else block.

