Day 3: Intro to Conditional Statements

vijaychauhanssn

Vijay Chauhan

Posted on May 29, 2021

Day 3: Intro to Conditional Statements
 'use strict';

  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  let inputString = '';
  let currentLine = 0;

  process.stdin.on('data', function(inputStdin) {
 inputString += inputStdin;
 });

 process.stdin.on('end', function() {
 inputString = inputString.split('\n');

 main();
});

 function readLine() {
 return inputString[currentLine++];
 }

  function main() {
  const N = parseInt(readLine().trim(), 10);
  if((N % 2 != 0)  || ((N > 5 && N <21) && N % 2 == 0)){
    console.log("Weird")
   } else {
    console.log("Not Weird")
  }

 }
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
vijaychauhanssn
Vijay Chauhan

Posted on May 29, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related