Question #46557

Evaluate the following c++ expression (assume x=-1,y=2)

A)x>y
B)x+y=y
1

Expert's answer

2014-09-24T12:33:33-0400

Answer on Question #46557, Programming, C++

Problem.

Evaluate the following c++ expression (assume x=-1, y=2)

A) x > y

B) x + y = y

Solution.

A) x > y is false, as -1 < 2.

B) We suppose that the correct statement is "x + y >= y", as "=" is assignment operator in C++, also see http://www.nios.ac.in/media/documents/TMAsr13/19D.Computer%20Science%20(330).pdf.


x + y >= y


is false, as -1 + 2 = 1 < 2.

Answer: A) false; B) false.

http://www.AssignmentExpert.com/

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS