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 fc433a3 commit b385a76Copy full SHA for b385a76
Selection Practice Problems/If-Else/CheckDate.js
@@ -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