- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise25.java
More file actions
Latest commit
15 lines (13 loc) · 638 Bytes
/
Copy pathExercise25.java
File metadata and controls
15 lines (13 loc) · 638 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
publicclassExercise25 {
publicstaticvoidmain(Stringarg[]) {
// Search online to learn the rules for leap years. Then write a program
// that can print out "leap year" or "not leap year" as appropriate for
// a given year.
// Hint: the most widely known rule is that any year that is divisible by 4
// is a leap year, and other years are not. But the actual rule is a little
// more complicated: it also depends on whether the year is divisible by 100,
// and whether it is divisible by 400.
System.out.print("Enter a year: ");
intyear = StdIn.readInt();
}
}