We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7801e7b commit ae2c0f2Copy full SHA for ae2c0f2
Selection Practice Problems/If-Else/LeapYear.js
@@ -0,0 +1,12 @@
1
+/*
2
+ Check if year is Leap or not
3
+*/
4
+
5
+const prompt = require("prompt-sync")();
6
+console.log();
7
+let year = (prompt(" Enter year : "));
8
+if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
9
+ console.log(" " + year + " is a leap year \n");
10
+} else {
11
+ console.log(" " + year + " is not a leap year \n");
12
+}
0 commit comments