CS FundamentalsHardService-company placement · ISTQB-style

A leap-year function follows the Gregorian rule (divisible by 4, except centuries, unless divisible by 400). Which test set has one year from each of the four input partitions?

  1. A. 1600, 2000, 2024, 2023
  2. B. 2400, 1900, 2000, 2021
  3. C. 1900, 2100, 2024, 2023
  4. D. 2000, 1900, 2024, 2023

Correct answer: D. 2000, 1900, 2024, 2023

The partitions are: divisible by 400 (2000), by 100 but not 400 (1900), by 4 but not 100 (2024), and not by 4 (2023). The other sets repeat a partition, for example 1600 and 2000 are both divisible by 400.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic