int a = 5;
int b = 3;
boolean c1 = !(a > 0 || b > 0);
boolean c2 = (a <= 0 && b <= 0);
System.out.println(c1 == c2);What is printed?
- A
false
- Bcheck_circle
true
- C
c1
- D
c2
Explanation
By De Morgan's: !(A || B) is equivalent to !A && !B. So c1 and c2 are logically equivalent (both false here), making c1 == c2 true.