Write a JavaScript that asks the user to enter the two numbers and outputs text that displays the sum, product, difference and quotient of the two numbers
const a = prompt('Input first number:');
const b = prompt('Input second number:');
const result = `
Numbers: ${a}, ${b}
- sum: ${a+b}
- product: ${a*b}
- difference: ${a-b}
- quotient: ${a/b}
`;
alert(result);
Comments
Leave a comment