C-17-Q120mediumsingle_mcq
The expression (year % 400 == 0 or (year % 100 != 0 and year % 4 == 0)) evaluates to True when:
The expression (year % 400 == 0 or (year % 100 != 0 and year % 4 == 0)) evaluates to True when:
- aThe year is a leap year
- bThe year is not a leap year
- cThe year is negative
- dThe year is a string
ব্যাখ্যা
This is the standard leap-year algorithm: a year is a leap year if it is divisible by 400, or divisible by 4 but not by 100. The boolean expression returns True precisely under those conditions, so it identifies leap years.