Two Expressions.

Q4. Given the two following expressions:

a.) val=3          b.) val= =3

i.) How are these two different?

ii.) What will be the result of the if the values of val is 5 initially?

Ans.

i.) The expression

a.) is an assignment expression.

b.) is a an relational expression that tests for equality.

ii.) The result of

a.) will be val having value 3 i.e., 3 and the result of

b.) will be boolean false because 5 is not equal to 3.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: