Skip to content

Commit b385a76

Browse files
committed
[Shreyash]: Added code to check entered date is between 20 march to 20 june
1 parent fc433a3 commit b385a76

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
Write a program that takes day and month from the command line and prints true if
3+
day of month is between ( March 20 and June 20 ), false otherwise.
4+
*/
5+
6+
const prompt = require("prompt-sync")();
7+
8+
console.log();
9+
let date = parseInt(prompt(" Enter Date : "));
10+
let month = parseInt(prompt(" Enter Month : "));
11+
12+
if ((1 <= date <= 20 && 3 < month <= 6) || (20 <= date <= 31 && 3 <= month < 6)) {
13+
console.log("\n True \n")
14+
} else {
15+
console.log("\n False! Check the Date \n");
16+
}

0 commit comments

Comments
 (0)