Question

1. Suppose that x, y and z are int variables, and x=5, y=7 and z =4,...

1. Suppose that x, y and z are int variables, and x=5, y=7 and z =4, Determine whether the following expressions evaluated to true or false

a). (x!=z%2)||(y! = z++)

b). (--x>= z) || (x+y!=z)

c). (x<=y-2) && (y%3>=z)&&(z-2!=20)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
a)  (x!=z%2)||(y! = z++)
=>  (5!=4%2)||(7! = 4++)
=>  (5!=0)||(7!= 4)
=>  true||true
=>  true
Answer: true

b)  (--x>= z) || (x+y!=z)
=>  (--5>= 4) || (5+7!=4)
=>  (4>= 4) || (12!=4)
=>  true||true
=>  true
Answer: true

c)  (x<=y-2) && (y%3>=z)&&(z-2!=20)
=>  (5<=7-2) && (7%3>=4)&&(4-2!=20)
=>  (5<=5) && (1>=4)&&(2!=20)
=>  true && false&&true
=>  false&&true
=>  false
Answer: false
Add a comment
Know the answer?
Add Answer to:
1. Suppose that x, y and z are int variables, and x=5, y=7 and z =4,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT