LET US STUDY C PROGRAMMING 5 Decision Making If statement

In c program the programmer specifies one or more conditions to evaluate and if the condition specified is correct move on else exit. C language handles decision-making by supporting the following statements.
if
statementswitch
statement- conditional operator statement (
? :
operator) goto
statement
if
statement
The if
statement can be implemented in different forms depending on the complexity of conditions for testing. The different forms are,
- Simple if statement
- if….else statement
- Nested if….else statement
- Using else if statement
Simple if statement
The syntax of simple if is
if
{
condition
}
Eg
if(a>b)
{
printf(“The value of A is greather than b”);
}
if….else statement
In this case 2 condition will check
if
{
condition statement
}
else
{
condition statement
}
In this expression is true, the condition 1 is executed, else condition 1 is skipped and condition 2 is executed.
Nested if….else statement
If Statement inside another IF Statement. Nested If in C is helpful if you want to check the condition inside a condition.
Else If Ladder
Else If statement in C effectively handles multiple statements by sequentially executing them.
if(test_expression)
{
//execute your code
} else if(test_expression n)
{
//execute your code
}
else
{
//execute your code
}