Discuss Nesting of If else statement in C language
Nesting of if .... else :- We can have another if ... else statement in the if part or the else part. This is called Nesting if .. else statement. Here is an example of nesting where we have if...else inside both if and else parts.
if (expression 1)
{
if (expression 2)
statement A1
else
statement A2
}
else
{
if (expression 3)
statement B1
else
statement B2
}
if (expression 1)
{
if (expression 2)
statement A1
else
statement A2
}
else
{
if (expression 3)
statement B1
else
statement B2
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment