C Programming :: Declarations and Initializations - Discussion
33 / 54
#include<stdio.h>
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");
}
#include<stdio.h>
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");
}
AHi!
BHey!
CHello!
DNone of these
Show Explanation
x>y+Z
2>1+1 = 2>2 false
x<y+z 2<2 false
condition goes to else and prints Hey!
Asked In ::
Here, the if block won't get executed as condition (x>y+z), or (2>1+1), becomes false.
Neither the else-if block will be executed, as (x<y+z), or (2<1+1), becomes false.
So, the else block will be executed at last, i.e, Hey! will be printed.
Hence, option B is correct.
Read Full Answer
Report Error
Please Login First Click Here
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!
Read Full Answer
Report Error
Please Login First Click Here
Your Answer is not correct Bhai proper post kiya kar , Bootstrap bhi nahi lagayi.
Read Full Answer
Report Error
Please Login First Click Here