when will be evaluated as true/
if(x==x==x)
a) x=1;
b) x=0;
c) x=-1;
d) none

Answers were Sorted based on User's Feedback



when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / naveen

o/p is x=0;
as x==x it will give 1 as result;
then again x==1;
so it will be false if x!=1i.e it will be true for only if
x value is 1.
i.e x=1 only if xis 1 other wise it is 0

Is This Answer Correct ?    21 Yes 3 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / singh

if block will be evaluated as true only if x=1.
because for first comparision x==x it returns 1.
then it again compares with x==x ie,x==1.
-it will return true only if x=1;

Is This Answer Correct ?    14 Yes 3 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / vikram

if x=1,then x==x evaluates to 1;
again,1==x evaluates to 1 only if x=1,
if(1) means condition becomes true and the if block will be
executed,
thnx

Is This Answer Correct ?    7 Yes 0 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / rukmanee

a: x=1;

Is This Answer Correct ?    3 Yes 1 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / hussain reddy

x=1

Is This Answer Correct ?    2 Yes 1 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / ramesh

none

Is This Answer Correct ?    1 Yes 2 No

when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none..

Answer / vignesh1988i

all the three cases possible as for as i know.......
x=1
x=0
x=-1

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More C Interview Questions

What is the use of getchar() function?

0 Answers  


what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means....

1 Answers   TCS,


Sir i want e-notes of C languge of BAlaguruswami book i.e scanned or pdf file of balaguruswamy book on c language.PLEASE SEND ME on my mail id ajit_kolhe@rediff.com

8 Answers  


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

0 Answers   Amazon,


i need all types of question paper releted to "c" and other language.

0 Answers  






Write a program to print "hello world" without using a semicolon?

0 Answers  


main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }

11 Answers   HCL, Vector, Vector India, Vector Solutions, Wipro,


Can we increase size of array in c?

0 Answers  


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

0 Answers  


What is header file definition?

0 Answers  


A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A

2 Answers  


What is the difference between char a[] = "string"; and char *p = "string"; ?

14 Answers   Adobe, Honeywell, TCS,


Categories