-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfElse.java
More file actions
14 lines (14 loc) · 520 Bytes
/
IfElse.java
File metadata and controls
14 lines (14 loc) · 520 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class IfElse {
public static void main(String[] args){
int year=2003;
if ( (year%4==0 && year%100 !=0) || (year%400==0) )
System.out.println(year+"is a leap year.");
else
System.out.println(year+"is not a leap year.");
int year2=2000;
if ( (year2%4==0 && year2%100 !=0) || (year2%400==0) )
System.out.println(year2+"is a leap year.");
else
System.out.println(year2+"is not a leap year.");
}
}