+ 2
what wiil be code or solution for cthis question
In the office, 2 monitors are connected to each computer. The first line of the given code takes the number of computers as input. Task Complete the code to calculate and output the number of monitors to the console. Sample Input 10 Sample Output 20 Hint Since each computer has 2 monitors, simply multiply the count of the computers by 2. Use the multiplication operator (*).
15 odpowiedzi
+ 4
Also have problem with this
Finally solved it :)
var computers = parseInt(readLine(), 10)
var monitors = 2;
var monitors = (computers*monitors);
console.log(monitors);
+ 3
Can you show us your code please? Ideally by posting it in the sololearn code playground and then providing a link. That way people can take a look and find out what is going on.
+ 2
1. All you have to do is multiply the input by two and output the result.
2. Please always tag the language you're asking about.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 2
var computers = parseInt(readLine(), 10)
//your code goes here
var monitors = computers*2
console.log(monitors);
+ 1
What's up with this
var computers = parseInt(readLine(), 10)
business?
Why not just
var computers = 10;
+ 1
var computers = parseInt(readLine(), 10)
//your code goes here
var monitors = 2;
var monitors = (computers*monitors);
console.log(monitors);
0
It's not working
0
The code which is given
var computers = parseInt(readline(), 10)
0
Language Java script
But the output is 36
And we will 10 ×2 the output is 20 only
0
https://code.sololearn.com/W1o92J84j21j/?ref=app here is the link
0
He doesnt even know what his own problem is @Peter, no point in giving him answers when he wont even make an attempt
0
// your code goes here
var monitors = 2;
var monitors = (computers*monitors);
console.log(monitors);
0
Thanks for the correct answer @Ionut
- 1
print(n*2)
- 1
For the code