PROBLEM 4
Easy

Kilometres to Metres

Programming Basics · JavaScript

</>
STATUS Not solved

TASK

Problem

#4

Given an integer number of kilometres `km`, convert it to metres.

EXAMPLE

Example

Input
7
Output
7000

LIMITS

Constraints

All numeric input values fit in JavaScript `Number`.
📖
LEARN Theory for this problem
+

### Kilometres to Metres

JavaScript arithmetic works with numeric values stored in variables. A clear solution reads the needed values, computes the formula with `+`, `-`, `*`, `/` or `**`, and prints only the final result.

💡
NEED HELP? Hints
+

['Write the formula using named intermediate values if it contains more than one operation.', 'After each iteration, it should be clear what has already been accumulated and what remains to be processed.']

ANSWER Solution
+
const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trimEnd();
let km = Number(input);
let result = ((km) * (1000));
console.log(result);