An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
May 29, 2021 05:52 am GMT
Original Link: https://dev.to/vijaychauhanssn/day-3-intro-to-conditional-statements-26hk
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('
'); 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") } }
Original Link: https://dev.to/vijaychauhanssn/day-3-intro-to-conditional-statements-26hk
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To