what is the output of below pgm?
void main()
{
int i=0;
if(i)
printf("pass");
else
printf("fail");
}




Answers were Sorted based on User's Feedback



what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else ..

Answer / himanshu goel

fail
because here if is taking 0 boolean value means condition
becomes false and else will be executed

Is This Answer Correct ?    12 Yes 0 No

what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else ..

Answer / sweta

fail

Is This Answer Correct ?    6 Yes 0 No

what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else ..

Answer / vignesh1988i

FAIL



THANK U

Is This Answer Correct ?    3 Yes 0 No




what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else ..

Answer / srikanth patchava

fail

if check value is thear or not ..if its thear it will got
frist printf other wise it will goto second printf

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More C Interview Questions

What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?

3 Answers  


Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.

1 Answers   TCS,


wat are the two methods for swapping two numbers without using temp variable??

2 Answers  


what is linkage error when it occurs in c program

3 Answers  


related to rdbms query .

2 Answers  






which one is highest Priority in c? a)=,b)+,c)++,d)==

4 Answers  


How we can write a value to an address using macro..?

0 Answers   Tata Elxsi,


what will be the output for the following program? main() { char ch = 'k'; char c; printf("%c",c); }

3 Answers  


what would be the output of the following program? main() { int k = 123; char *ptr; ptr = &k; printf("%d",*ptr); }

4 Answers  


what is inline function?

2 Answers  


Write any data structure program (stack implementation)

1 Answers   HTC,


void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case

9 Answers   TCS, Accenture,






Categories