operation in C++. Please, help me :)

Aug 3, 2012 at 7:37am
Can you please help me with this question.
Please give me a brief explaination.
thank you so much.

If a, b, and c are integer variables, some of these expressions are valid C++ and others are not. For each expression, add parentheses to indicate the precedence and associative rules, and hence decide which are valid and which are not. In each case, briefly explain in words the meaning of the valid expressions, or why the expression is not valid.
a == b = c;
a = b == c;
a == b == c;
Aug 3, 2012 at 7:43am
= is assignment, it puts the value into a variable

== is comparison, it results in the expression being false (0) or true (any other value)

You need to be aware of the precedence of operators .

Edit:

To answer this properly you need to know the value of all the variables.
Last edited on Aug 3, 2012 at 7:44am
Topic archived. No new replies allowed.