x=2,y=6,z=6
x=y==z;
printf(%d",x)

Answers were Sorted based on User's Feedback



x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / preethi

y==z true
so, x=1

Is This Answer Correct ?    78 Yes 6 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / guest

y==z checks if both are equal and returns TRUE or FLASE
(1 / 0). In this case y = z = 6, so it returns TRUE / 1. x
= 1.

Is This Answer Correct ?    26 Yes 0 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / amit

since "=" has a low precedence over "==" .. thus "y==z" will
be evaluated first and the returned value will be stored in
x which will be printed subsequently...

In this case since y equals z, x = 1 will be printed

cheers

AD

Is This Answer Correct ?    15 Yes 0 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / anand n

Ans:1


x=2,y=6,z=6//here x value is:2
x=y==z;//x=6 and y=6 so x is equal to y means its true,now
//x value is 1
printf(%d",x)

Is This Answer Correct ?    8 Yes 1 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / vijoeyz

My apologies for the silly mistake. The value of x is 1 as
everyone has said.

Thanks,
Vijay Zanvar
http://faq.zanvar.in

Is This Answer Correct ?    7 Yes 2 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / priya

answer: 1

Is This Answer Correct ?    3 Yes 0 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / mahadevan

in C language this statement(x=y==z;)is declaration syntax Error

Is This Answer Correct ?    5 Yes 2 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / suchita

here we can not use and conditional statement thats why we can
not say "this is a boolean eq" and thats why x print either 2 or
garbage value

Is This Answer Correct ?    7 Yes 5 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / wasim

First of all the given syntax for printf statement is
wrong.it will not show any output but the syntax error

Is This Answer Correct ?    1 Yes 1 No

x=2,y=6,z=6 x=y==z; printf(%d",x) ..

Answer / manjunath kusagur

in memory first location hold value of x as 2....ofter
assigning x=y..x(6)<-y..value of x is overwritten because
memory location holds only one value at a time means now x
holds value as 6......

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What are runtime error?

0 Answers  


What is a dynamic array in c?

0 Answers  


When would you use a pointer to a function?

0 Answers  


Is it better to bitshift a value than to multiply by 2?

0 Answers  


What is else if ladder?

0 Answers  






what is the output of the following program? main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

7 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


diff between exptected result and requirement?

0 Answers   HCL,


Why is c called c?

0 Answers  


write a own function for strstr

1 Answers   LG Soft,


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

0 Answers   Wipro,


the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789

5 Answers  


Categories