Back In the print window choose "Save as PDF" as the destination
NOTE.CS

Leap Year

1 topic ยท 28 Nov 2026
1

Leap Year

Problem Solving

Rule: a year is a leap year if it is divisible by 400, or divisible by 4 but not by 100.

Example: 2000 and 2024 are leap years; 1900 is not.

C++
int y = 2024;
if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)
    cout << "Leap Year";
else
    cout << "Not Leap Year";