Assume that x and y are int variables with x = 5, y = 3, and a and d are char variables with a = 'a' and d = 'A', and examine the following conditions:


Assume that x and y are int variables with x = 5, y = 3, and a and d are char variables with a = 'a' and d = 'A', and examine the following conditions:


Condition 1: (x < y && x > 0)

Condition 2: (a != d || x != 5)

Condition 3: !(true && false)

Condition 4: (x > y || a == 'A' || d != 'A')

a) All 4 Conditions are true

b) Only Condition 2 is true

c) Condition 2 and Condition 4 are true only

d) Conditions 2, 3 and 4 are all true, Condition 1 is not

e) All 4 Conditions are false

Answer: d. Explanation: Condition 1 is not true because (x < y) is false, making the entire condition false. Since (c != d) is true, Condition 2 is true even though (x != 5) is false. Condition 3 is true because (true && false) is false, but !false is true. Condition 4 is true because (x > y) is true, making the entire Condition true. Therefore, Conditions 2, 3 and 4 are true while Condition 1 is false.