Answers for "to add 2 numbers using function in javascript"

11

how to add two numbers in javascript

let a = 4;
let b = 5;
document.write(a + b);
Posted by: Guest on September-16-2020
0

how to add 2 numbers together in javascript

var x = +y + +z;
Posted by: Guest on January-02-2021
-2

to add 2 numbers using function in javascript

// Prints the sum of 2 float numbers 
function addition(number_1, number_2)
{
  int sum = number_1 + number_2
document.write(sum)
}

var number_1 = parseFloat(prompt("First Number"));
var number_2 = parseFloat(prompt("Second Number"));
addition(number_1, number_2);
Posted by: Guest on August-12-2020

Code answers related to "to add 2 numbers using function in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language