Basic Programming Unit Test 5 of 265 of 26 Items Qauestion What will be the output of 2021 passed to the method of a leap year?(1 point) Responses The program will throw an error. The program will throw an error. There will not be an outcome. There will not be an outcome. 2021 is not a leap year. 2021 is not a leap year. 2021 is a leap year. 2021 is a leap year. Skip to navigation page 1 of 1

1 answer

The correct response regarding whether 2021 is a leap year is:

2021 is not a leap year.

To expand, a leap year occurs if:

  1. It is divisible by 4;
  2. However, if it is divisible by 100, it must also be divisible by 400 to be a leap year.

Since 2021 is not divisible by 4, it does not qualify as a leap year. Therefore, if passed to a method that checks for leap years, the output would indicate that 2021 is not a leap year.