NESTED IF

If within if is called nested if and it is used when we have multiple conditions to check and when any if condition contains another if statement then that is called ‘nested if’.

If the external condition is true, then the internal if condition or condition are executed and if the condition is false then the else portion is executed of the external if statement

SYTAX

if (condition)

{

…….

…….

}

if (condition)

{

…….

…….

}

else if (condition)

{

…….

…….

}

else if (condition)

{

…….

…….

}

else

{

…….

……. }

}

else

{

…….

…….

}