If-Else and their nesting
If-Else
The use of If-Else in conditional programming. if we have the situation like print the value when x >10. then we use the if-else
it will be any type of situation. if means when and else me otherwise.
Syntax
if(condition)
{
statement;
}
else
{
statement;
}
Nesting of If-Else
it is use when we have many situation. for example:- find out the greatest among three variable . we use nesting of If-Else.
Syntax
if(condition)
{
statement;
}
else if (condition)
{
statement;
}
else if(condition)
{statement;}
To know more about the nesting with the example click the link given below. please subscribe the channel.
https://www.youtube.com/watch?v=e57bKcMEWtY&list=PLzzgUe_4aGJ5g3kxleH86WscmKRWiZZX_&index=8
The use of If-Else in conditional programming. if we have the situation like print the value when x >10. then we use the if-else
it will be any type of situation. if means when and else me otherwise.
Syntax
if(condition)
{
statement;
}
else
{
statement;
}
Nesting of If-Else
it is use when we have many situation. for example:- find out the greatest among three variable . we use nesting of If-Else.
Syntax
if(condition)
{
statement;
}
else if (condition)
{
statement;
}
else if(condition)
{statement;}
To know more about the nesting with the example click the link given below. please subscribe the channel.
https://www.youtube.com/watch?v=e57bKcMEWtY&list=PLzzgUe_4aGJ5g3kxleH86WscmKRWiZZX_&index=8
Comments
Post a Comment