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
Get step-by-step solutions from verified subject matter experts
