Created
February 21, 2014 05:45
-
-
Save ltagliaferri/9129436 to your computer and use it in GitHub Desktop.
This file contains 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
public class LeapYear { | |
public static void main (String args[]) { | |
int year = Integer.parseInt(args[0]); | |
if ((year % 4 == 0) && (year % 100 != 0)){ | |
System.out.println(year + " is a leap year."); | |
} | |
else if ((year % 100 == 0) && (year % 400 == 0)){ | |
System.out.println(year + " is a leap year."); | |
} | |
else{ | |
System.out.println(year + " is not a leap year."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment