-1

store input numbers

const num1 = parseInt(prompt('Enter the first number '));
const num2 = parseInt(prompt('Enter the second number '));

//add two numbers
const sum = num1 + num2;

console.log(`The sum of ${num1} and ${num2} is ${sum}`);

display the sum

console.log(`The sum of ${num1} and ${num2} is ${sum}`);
Maniraj Murugan
  • 8,868
  • 20
  • 67
  • 116

1 Answers1

0

The default prompt and window are not defined in the node environment. But if you want to use prompt-sync try this

sat
  • 91
  • 8