This is a Java related question 1 2 pts What do the followin

This is a Java related question:

1. (2 pts.) What do the following expressions evaluate to in Java given int x = 3, y = 6;

a) x == y / 2

b) x % 2 == 0 || y % 2 != 0

c) x - y < 0 && !(x >= y)

d) x + 6 != y || x / y <= 0

Solution

Ans)a,c,d

a)x == y / 2

3==6/2

3==3 which is true

c)x - y < 0 && !(x >= y)

3-6<0 && !(3>=6)

true && true which is true

d) x + 6 != y || x / y <= 0

3+6!=6 || 3/6<=0

true || true, which is true

_________________________

This is a Java related question: 1. (2 pts.) What do the following expressions evaluate to in Java given int x = 3, y = 6; a) x == y / 2 b) x % 2 == 0 || y % 2

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site