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
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 |
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 |
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 |
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 |
what are the advantage and disadvantage of recursion
How can you read a directory in a C program?
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?
Describe the order of precedence with regards to operators in C.
write a c program to store and print name,address,roll.no of a student using structures?
Should I learn c before c++?
what is different between auto and local static? why should we use local static?
What is volatile in c language?
Is it possible to run a c program without using main?If yes HOW??
what is the diff b/w static and non static variables in C. Give some examples plz.
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
0 Answers College School Exams Tests,
Develop a program that computes the new price of an item. The program should receive a character variable colour and a double precision floating-point variable price from the user. Discount rate is determined based on the colour of the discount sticker, as shown in the following table. An error message should be printed if an invalid colour has been entered