Day 5: Loops
Vijay Chauhan
Posted on June 3, 2021
'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);
for (let i = 1; i<=10; i += 1){
console.log(`${n} x ${i} = ${n * i}`)
}
}
💖 💪 🙅 🚩
Vijay Chauhan
Posted on June 3, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
tailwindcss Implementing Dark Mode and Theme Switching using Tailwind v4 and Next.js
November 29, 2024