May 21, 2020

If-Else-If statement in C

In C if-else-if ladder is used to decide from among multiple options. 
It means if-else-if ladder is a way of putting multiple if's together when multipath decisions are involved.


Syntax of if-else-if ladder:


if(condition 1)

{
     //block of statements;
}
else if(condition 2)
{
    //block of statements;
}
else if(condition 3)
{
    //block of statements;
     .
     .
     //upto n statements;

}
else
{
    // default statement;
}


Above syntax shows the working of if-else-if ladder.


Share This:    Facebook Twitter

0 comments:

Post a Comment

If you have any doubts, please discuss here...