Created
May 4, 2013 12:42
-
-
Save jimmy087/5517387 to your computer and use it in GitHub Desktop.
Display leap years
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Displaying leap years. | |
| public class Exercise4_27 { | |
| public static void main (String[] args) { | |
| System.out.println("The following are the leap years"); | |
| System.out.println("--------------------------------"); | |
| int count = 0; | |
| for (int i = 2000; i <= 2100; i++ ) { | |
| if (i % 4 == 0) { | |
| count++; | |
| System.out.print((count % 10 != 0) ? i + " " : i +"\n" ); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment