[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

14 / 54

What is the output of the following program?

#include<stdio.h>
void main()
{
int i= 5;
if (i == 5) 
return 0;
else 
printf("i is not five");
printf("over");
}

Aa syntax error

Ban execution error

Cprinting of overan error message

Dexecution termination, without printing anything

Answer: Option (Login/Signup)

Show Explanation

Clearly we can see that i value is initialised 5 and the condition i==5 is also true. Hence return 0; will be executed and the execution will be terminated without printing anything coz its return 0 and not print 0.



Return statement brings the control of the program out of the loop.

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +1 -0 +
    Report


Report Error

Please Login First Click Here