Skip to content

Commit 264f59d

Browse files
Create leapYear.js
1 parent 5a2653c commit 264f59d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

leapYear.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function leapYear(year){
2+
3+
if(year%4===0){
4+
5+
if(year%100===0){
6+
if(year%400===0){
7+
return("Leap year.");
8+
}
9+
10+
else{
11+
return("Not a leap year.");
12+
}
13+
14+
}
15+
else{
16+
return("Leap year.");
17+
}
18+
19+
}
20+
21+
else{
22+
return("Not a leap year.");
23+
}
24+
25+
return year;
26+
}

0 commit comments

Comments
 (0)