Practice-It! logo

Self-Check 5.14: logicExpressions2

Added by: Leslie Ferguson
Keywords: expressions, logic

Given the following variable declarations:

int x = 27;
int y = -1;
int z = 32;
boolean b = false;

What is the value of each of the following boolean expressions?

!b
b || true
(x > y) && (y > z)
(x == y) || (x <= z)
!(x % 2 == 0)
(x % 2 != 0) && b
b && !b
b || !b
(x < y) == b
!(x / 2 == 13) || b || (z * 3 == 96)
(z < x) == false
!((x > 0) && (y < 0))

You must log in before you can solve this problem.

user
Log In

If you do not understand how to solve a problem or why your solution code doesn't work, please contact your TA or instructor.

If something seems wrong with the Practice-It system itself (errors, slow performance, incorrect problem descriptions/tests, etc.), please contact us.


Is there a problem?
Contact a Practice-It administrator.