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

What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

1 Answers  


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


Printf can be implemented by using __________ list.

3 Answers  


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 Answers  






prog. to produce 1 2 3 4 5 6 7 8 9 10

4 Answers   TCS,


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


why array index always strats wuth zero?

2 Answers  


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

1 Answers  


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


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

7 Answers  


Categories