main(){

int a= 0;int b = 20;char x =1;char y =10;

if(a,b,x,y)

printf("hello");

}



main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) ..

Answer / susie

Answer :

hello

Explanation:

The comma operator has associativity from left to right.
Only the rightmost value is returned and the other values
are evaluated and ignored. Thus the value of last variable y
is returned to check in if. Since it is a non zero value if
becomes true so, "hello" will be printed.

Is This Answer Correct ?    22 Yes 1 No

Post New Answer

More C Code Interview Questions

int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


How to palindrom string in c language?

6 Answers   Google,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


How to return multiple values from a function?

7 Answers  


find simple interest & compund interest

2 Answers  






Write a program to model an exploding firecracker in the xy plane using a particle system

0 Answers   HCL,


How we will connect multiple client ? (without using fork,thread)

3 Answers   TelDNA,


char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

1 Answers  


Categories