Write out the Syntax of Nested if Statements?
The universal form is
If(expression 1)
{
if (expression 2)
{
Statements 1;
}
else
{
Statements 2;
}
}
else
{
Statements 3;
}
In this, If the first expression is true then the following if statement gets executed and If the expression 2 is true then statements 1 gets executed otherwise statements 2 will be executed and comes out of the block and If the expression 2 is false, it comes to the final else statement and Statements 3 gets executed.