[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Declarations and Initializations - Discussion

Home > C Programming > Declarations and Initializations > MCQs Questions Discussion

33 / 54

What is the output of the following program?

#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

Answer: Option (Login/Signup)

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 ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +2 -0 +
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here