Sociology, asked by patilisha3100, 5 months ago

write a javascript program to accept two numbers and perform addition of two numbers by using mouseover event

Answers

Answered by sharonthomas28
11

hope it is helpful for you

Attachments:
Answered by ssanskriti1107
10

Answer:

num1 = 10, num2 = 20, sum = 30

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