I have this logical operator expression:
!(!(a != b) && (b > 7))
How do you simplify it and find the equivalent?
I have this logical operator expression:
!(!(a != b) && (b > 7))
How do you simplify it and find the equivalent?
Use Demorgan's Laws.
!(!(a != b) && (b > 7))
!!(a != b) || !(b > 7)
a != b || b <= 7
As mentioned by others: Demorgan's Laws
!(!(a != b) && (b > 7)) // x != y --> !(x == y)
!(!!(a == b) && (b > 7)) // !!x --> x
!((a == b) && (b > 7)) // !(x && y) --> !x || !y
!(a == b) || !(b > 7) // !(x == y) --> x != y;; !(x > y) --> x <= y
(a != b) || (b <= 7)