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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!