write a javascript program to accept two numbers and perform addition of two numbers by using mouseover event
Answers
Answered by
11
hope it is helpful for you
Attachments:
Answered by
10
Answer:
num1 = , num2 = , sum =
Explanation:
Code:
const num1 = parseInt(prompt('Enter the first number '));
const num2 = parseInt(prompt('Enter the second number '));
const sum = num1 + num2;
console.log(`The sum of ${num1} and ${num2} is ${sum}`);
Summary:
- Prompt - It is used to accept input from the user
- parseInt() - It is used to convert input string to integer.
- For the result to be displayed, we have used the template literal ` `.
#SPJ3
Similar questions