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 is the different between data structure and data type?

1 Answers   Ignou,


Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;

18 Answers   HCL, TCS, Infosys, Cisco, Accenture, Egentec, Ideaz, M-Systems, MYR,


int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?

4 Answers   TCS,


what is default constructor?

2 Answers   HCL,


34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?

3 Answers  






find largest of 3 no

8 Answers  


write a program to delete an item from a particular location of an linear array?

1 Answers  


how to impliment 2 or more stacks in a single dimensional array ?

1 Answers   Microsoft, iFlex,


Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d

1 Answers   TCS,


Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain

2 Answers  


why array index always starts from zero??

4 Answers   TCS,


program to find the second largest word in a paragraph amongst all words that repeat more thn twice

4 Answers   iGate, CTS,






Categories