-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleapyear2.java
More file actions
36 lines (33 loc) · 827 Bytes
/
Copy pathleapyear2.java
File metadata and controls
36 lines (33 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.util.*;
public class leapyear2
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
System.out.println("enter the year:");
int y=s.nextInt();
boolean isleap=false;
if(y%4==0)
{
if(y%100==0)
{
if(y%400==0)
{
isleap=true;
}
else
isleap=false;
}
else
isleap=true;
}
else
isleap=false;
if(isleap==true)
{
System.out.println("the year is a leap year");
}
else
System.out.println("the year is not a leap year");
}
}