Answer to Question #284441 in HTML/JavaScript Web Application for durgasuany

Question #284441

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


1
Expert's answer
2022-01-04T01:10:15-0500
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);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS