Nested if-else statements

It is possible to nest if-else statement in an if or else statement. i.e. we can make use of more than one if-else statement by nesting them. There is not limit to the number of if-else nesting. The general form of nested if-else is:
if(test condition1)
{
if(test condition2)
{
statement-block-1;
}
else
{
statement block-2;
}
else
{
statement block-3;
}
}

No comments:

Post a Comment