1. A leap year takes place when the year is divisible by 4, unless the year is divisible by 100 and not by 400.
Write a C++ expression that returns true only if year is a leap year.
(year % 4 == 0) && !((year % 100 == 0) && (year % 400 != 0))
2. Simplify the expression:
X && Y || X && !Y
X
3. Simplify the expression:
!!(!(!X || !Y) && Z)
X && Y && Z4. Given X = true, Y = false, and Z = true, evaluate
a) true
b) false