C Programming :: Declarations and Initializations
Home > C Programming > Declarations and Initializations > Discussion
33. What is the output of the following program?
void main()
{
int x,y, z;
x=2; y=1; z = 1;
if(x > y + z)
printf("Hello!\n");
else if (x < y+ z)
printf ("Hi!\n");
else
printf("Hey!\n");
}
Answer: Option B
Explanation :
answer is option B x>y+Z 2>1+1 = 2>2 false x<y+z 2<2 false condition goes to else and prints Hey!
STEP-BY-STEP
answer is option B
x>y+Z
2>1+1 = 2>2 false
x<y+z 2<2 false
condition goes to else and prints Hey!
Report Error
Please Login First Click Here
STEP-BY-STEP
Your Answer is not correct Bhai proper post kiya kar , Bootstrap bhi nahi lagayi.
Report Error
Please Login First Click Here