JavaScript function for addition for two number

javascript function for addion of two numbers



// 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;

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


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.