logo CodeStepByStep logo

logical_expressions

Language/Type: C % expressions
Author: Allison Obourn (on 2020/09/14)

Trace the evaluation of the following expressions, and give their resulting values. Write true if the expression would have a true result and false otherwise.

int x = 42;
int y = 17;
int z = 25;
y < x && y <= z
x % 2 == y % 2 || x % 2 == z % 2
x <= y + z && x >= y + z
!(x < y && x < z)
(x + y) % 2 == 0 || !((z - y) % 2 == 0)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.