-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFun52.java
More file actions
36 lines (34 loc) · 918 Bytes
/
Fun52.java
File metadata and controls
36 lines (34 loc) · 918 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
package fun;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> fun
* Class Date -> 6/20/2022/ 21:30 PM
*/
public class Fun52 {
public static void main(String[] args) {
System.out.println (IsLeapYear (2000));
System.out.println (IsLeapYear (2004));
System.out.println (IsLeapYear (2008));
System.out.println (IsLeapYear (2020));
System.out.println (IsLeapYear (2010));
}
public static boolean IsLeapYear(int y) {//2020 100
int b, d, e, c, f;
b = y % 100;//1300 = b ==> 00
c = y % 400;//1300-1200= c ==> 100
f = y % 4;
if ( b == 0 ) {
if ( c == 0 ) {
return true;
} else {
return false;
}
} else {
if ( f == 0 ) {
return true;
} else {
return false;
}
}
}
}