Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago

Question

Have issues been prioritized?

Answered: 1 week ago