Question 221
Consider the following code segment.
boolean a = true;
boolean b = false;
boolean c = true;
boolean value = !(a && b) && (b || c) && !(a && !c);
What value is stored in value?
Main Solution
Answer
Answer: C. !(a && b) is true, (b || c) is true, and !(a && !c) is also true because !c is false.
Answer: Correct: C
A
false, because a && b is false
B
false, because b is false
C
true
D
false, because a is true
Answer images

