Question
coding with JS, Write a program that square an integer and print the result given code: process.stdin.resume(); process.stdin.setEncoding('utf8'); var stdin = ''; process.stdin.on('data', function (chunk)
coding with JS,
Write a program that square an integer and print the result
given code:
process.stdin.resume();
process.stdin.setEncoding('utf8'); var stdin = ''; process.stdin.on('data', function (chunk) { stdin += chunk; }).on('end', function() { var lines = stdin.trim().split(' '); for(var i=0; i Your program should read lines from standard input Each line will contain a positive integers Test 5 Output, For each line of input print to standard output the square of the number Print. Print out each result on new line. expected Output 25 screenshoot your coding and the output as well. thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started