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 ?    12 Yes 0 No

Post New Answer




More C Code Interview Questions

Write a c program to search an element in an array using recursion

1 Answers   Wipro,


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


find simple interest & compund interest

2 Answers  


write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .

2 Answers  


main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

1 Answers   Zoho,






Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

9 Answers   Microsoft,


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5

2 Answers   HCL,


int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%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,


void main() { int i=5; printf("%d",i++ + ++i); }

3 Answers  






Categories