What is Nested IF else Statement
Nested IF else Statement:-
It is conditional statement which is used when we want to
check more then one condition at a time a same program What is Nested IF else Statement. The condition are executed from top to bottom checking each condition wheather it meets the conditional criteria or not.If it found the condition is true then it executed the block of associated statement of true part else it goes to next condition to executed.
Example:-
Int main()
{
Int a,b;
printf(“\n enter a and b value”);
Scanf(“%d%d”,&a,&b);
If(a>b)
If(a!=0)&&(b!=0)
Printf(“\n a and b both are +ive and a>b”);
else
Printf(“\n a is greater then b only”);
else
Printf(“\n a is less then b”);
}
Post a Comment