#include<stdio.h>
int main()
{
int x=1,y=1,z;
if(y<0) if(y>0) x=3;
else x=5;
printf(“%d\n”,x);
printf(“%d\n”,y);
return 0;
#include<stdio.h>
int main()
{
int x=1,y=1,z;
if(y<0) if(y>0) x=3;
else x=5;
printf(“%d\n”,x);
printf(“%d\n”,y);
return 0;
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
there is nested if first if is false as y=1 so it does not execute second if and print value of x and y i.e 1
it is like a whole if and else within a single if
pictorially:
if(condition)
{
if(condition)
execute;
else
execute;
}