218k views
11 votes
Observe the following statements and decide whether the variable result’s value is TRUE or FALSE.

Given that:

    int x = -77;

    int z = 43;

result = (z < x && 1 != 10) ? true : false;

result = 90 < x || -1 < z;

#OED​

1 Answer

1 vote

Answer:

result 1 = false;

result 2 = true;

Step-by-step explanation:

result 1 = (43 < -77 && 1! = 10)

43 < -77 = false

1 != 10 = true

for any false && true logical operator, it returns false

result 1 = false;

false = 90 < -77 || -1 < 43

90 < -77 = false

-1 < 43 = true

for any false || true logical operator, it returns true

result 2 = true;

User Pandoro
by
5.2k points