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 is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }

6 Answers  


What is a stream?

0 Answers  


write a programming in c language, 1 3 5 7 9 11

2 Answers   NIIT,


Explain what?s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?

1 Answers  


What is data type long in c?

0 Answers  






what is the program to display your name in any color?

2 Answers   HCL,


How to throw some light on the b tree?

0 Answers  


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

0 Answers  


How would you find a cycle in a linked list?

3 Answers   NSN,


What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }

1 Answers   Google,


What is the difference between text files and binary files?

0 Answers  


Categories