showing results for - "javascript function to add two numbers"
Gaia
11 Jan 2021
1const num1 = 5;
2const num2 = 3;
3
4// add two numbers
5const sum = num1 + num2;
6
7// display the sum
8console.log('The sum of ' + num1 + ' and ' + num2 + ' is: ' + sum);
Axel
18 Nov 2016
1<!--Add two integer numbers using JavaScript.-->
2<html>
3	<head>
4		<title>Add two integer numbers using JavaScript.</title>
5		<script type="text/javascript">
6			function addTwoNumbers(textBox1, textBox2){
7				var x=document.getElementById(textBox1).value;
8				var y=document.getElementById(textBox2).value;
9				var sum=0;
10				sum=Number(x)+Number(y);
11				alert("SUM is: " + sum);
12			}
13		</script>
14	</head>
15<body>
16	<h1>Add two integer numbers using JavaScript.</h1>
17	<b>Enter first Number: </b><br>
18	<input type="text" id="textIn1"/><br>
19	<b>Enter second Number: </b><br>
20	<input type="text" id="textIn2"/><br><br>
21	<input type="button" id="btnSum" value="Calculate SUM" onClick="addTwoNumbers('textIn1','textIn2')"/>
22</body>
23
24</html>
25
Alphonso
06 Mar 2017
1// Prints the sum of 2 float numbers 
2function addition(number_1, number_2)
3{
4  int sum = number_1 + number_2
5document.write(sum)
6}
7
8var number_1 = parseFloat(prompt("First Number"));
9var number_2 = parseFloat(prompt("Second Number"));
10addition(number_1, number_2);
queries leading to this page
add 2 integers function javascriptjavascript addition of two numbersadd in javscripthow to add numbers when calling a function in htmlnode js adding of multiple numbersjavascript a function that adds two numbershow to concatenate two numbers in jsjavascript add two numbers in for loopsadding two numbers in javascript w3schoolshow to create a script for adding in javascript between two numbersaddition of two numbers in javascript using function w3schoolshow to add 2 numbers in jsadd number in javascriptadd x 2b y function javascript add in javascriptadd numbers together javascripttwo number addition program in javascriptadd two numbers javascript solutionjavascript addittionadding in javascriptfunction to add two numbers javascriptwrite a function to add three numbers in javascriptfunction adding example javascriptadd to variableadd two numbers javascript functionjavascript plus 2 numbershow to add two numbers in javascript declaring variableshow to sum two numbers in javascriptjavascript add two numbers instead of concatenatejavascript function for addition of two numberscombine numbers jswhat is value 3d add in javascripthow to keep adding numbers together javascriptadd to no javascriptadd 27 in jshow add two numbers in javascriptsum two numbers gives 2a javascriptjavascrfipt sum two numbersadd two numbers in javascriptjavascript function to add two integersadd two integers jsjavascript divided symboladd of two numbers in jsjavascript add two valuessimple function add two numbers in javascript usingadd numbers in javascriptfunction to add two numbers in javascriptadd values in javascriptaddition of two numbers in html using javascriptaddition of two numbers in javascript using functionadd two numbers jsnode js javascript a function that adds two numberswrite a function to add two numbers in javascriptjs additionaddition of two numbers without using 2b operator in javascripthow to add numbers javascripthow to add two numbers in javhow to add two numbers in javascript dynamicallyjavascript plus 2add 2 numbers on javascripthow to add bnumbers in javascript 1 wap to add two numbers in javascriptjavascript add two integershow to addition two number in javascripthow to add two numbers together in javascriptjavascript how to sum two numbersadd 2 numbers script javaadding to a variable jsadd two number in javascriptjavascript adding variablesadd two numbers in node jsjs addition of two numbers2 add two numbers javascriptadd number javascripthow to addition of two numbers in javascriptfunction to add two numbers jsaddition of two numbers using functions in javascript with parametershow to add two numbers javascriptadding 2 numbers in javascriptjavascript 2b 3d how to add two number javascript htmlvariable addition jsgetting two numbers and add it by javascriptjavascript adding two numbersadd to number javascriptaddition of two numbers in javascript 2b 3d javascriptjavascript function sum 2 numbersaddition javascript more than 10 numbersadd two numbers using function in javascriptconcat numbers javascripthow to add 2 numbers javascriptjavascript add two numberjavascript custom function for adding two numbersadd two numbers injs program addition of two numbers using functions in java scripthow to add two numbers in javascript w3schoolsjs math add 2 valueshow to add twonumbers in jsjs add two string numbersadd two numbers in javascript in java 2b 3d html javascriptprogram in javascript to add two numbershow to sum 2 numbers in javascriptadd up two integers in javascriptjavascript additionhow to add two int in jsaddition in js wap to add two numbers in javascriptvalue plus function in javascriptjs sum two numberadding two numbers in javascript using functionjavascript how to plus two numbersfunction add two numbets javascripthow to add two numbers in javascript functionhow to add two numbers in js6add two numbers function javascriptsum two integers javascriptjs addition operatorfunction to add numbers jsadd a 2b to a variable in javascriptjavascript add value to varjs addition functionadding to variable javascript to new varibalecode for addition of two numbers in javascriptjavascript add numbers togetheradd 2c to numbers javascriptaddition in javascriptadding two numbers in javascript mathjavascript function to return the sum of two numbershow to add 5 to variable in javascriptadd 27 27 to value jsadding the values in plus and minius in javascriptaddition of two number using function in javascript adding numbers in javascriptadd multiple numbers javascriptjavascript program to add two numbersjs add to variablejavascript add two numbers htmlhow to add two numbers variables in javascriptadd in jsjavascript add 2 numbers2 add two numbers in jshow to perform addition of two values in javascriptaddition function javascriptadd two numbers function jsjavascript add to variabelhow do i add and compare two numbers in javascripthow to plus two values in javascriptsimple adding for 2 number in jsjavascript concatenate two numbersjava script code for addition of two numberadd two number using java scripthow to add of two numbers in javascriptadd 2 or more number as a single value in jsadd up the numbers from a single number javascriptsum of two numbers in javascript using functionadd 2 numbers jshow to add in jsconcatenate two numbers in javascriptjavascript programs for adding 2 numbers javascript addition of numbers inputted by useradding two number in java scriptadding variables in javascripthow to add in javacript 2b 2badd two numbers in javascript htmladdition of two numbers using functions in javascriptinside function after adding two numbers why it coming as string in javascriptwrite a program to add two numbers in javascriptjavascript add valueadd two numbers in javascript using functionhow to add two numbers in jssum 2 number function in jshow to add numbers jshow to join 2 or more numbers in js dynamicallyadd in javascripthow to add two variable numbers in javascriptadding two variable numbers in jsjavascript function add two numbersfunction statement javascript adding 2 numbershow to add 2 numbers in javascriptjavascript add 2 numbers from inputadd 2 integers in javascriptadd number variable javascripthow to add in javascripthow to int plus values in jshow to add 3 numbers in javascriptjavascript adding 2 numbersjavascript add sum two numbers javascriptadd two numbers in javascript functionjava script add two numbers concatenatgeadd value in javascriptif add should add two numbers javascriptaddition of 2 numbers in javascriptfunction that adds two numbers javascriptsum two number in javascriptaddition of two numbers function in jsmaths add two numbershow to join 2 or more numbers in js how add two number in javascriptaddition in jsjs adding two numbersadd two number in jjs sum 2 numbersmultiply javascriptadding two numbers in javasciptjavascript add numberadd two numbers in javascript and htmlsum of two numbers javascript with functionhow to add two nubers in jssum of 2 numbers javascriptjavascript add by 2add 2 numbers javascriptjavascript function that adds two numbersadd two numbers in html using javascriptadd two numbers in javascript domadd 2 numbers using javascriptfunction for adding 2 numb in jsjavascript to add two numbersfunction to get two numbers and add them in javascripthow to add to a variable jshow to join 2 numbers in javascriptjavascript program to add two numbers in htmladd two integers in javascriptjavascript code to add two numbersaddition two value jshow to add 2 int variables in javascriptcalculating function add 2 numbers jsaddiotion javascripthow to add two numbers in javascriptjs how to add 5js function to sum two numberjavascript and html add two numbershow to add two integers in javascripthow to add 2 number in javascriptadding variables javascripothow to combine number in javascriptadd two values in javascriptjs code to add two numbershow to add many numbers together in javascriptjavascript to add two numbers using functionjavascript code to add 3 numbersadd 2 numberrs in jsadding two numbers in javascriptaddition javascript to htmlprogram to add two numbers in javascriptjavascript sum two numbersmultiples sign in javascript2 2b 3d in jsadd 2 numbers in a javascript functionto add two numbers in javascriptsum two values javascriptjs 2b 3dhow to add two integer values in javascriptuse javascript to adding numberstwo numbers not adding in jsaddition in a function javascripthow to write a function add 2 numbers in javascriptjs add two numbersnodejs add two numbersaddition of two numbers in javascript using htmlhow to add the integers of a two integer javascriptsum two number javascriptaddition of numbers in javascriptadd numbers jsadding 2 numbers in java scripthow to add numbers in javascript functionif it 2 add 1 in javascriptadd multiple values jshow to add together numbers wihtou 2b jsadding two numbers jsjavascript sum two numberadd 2 numbers in javascript with getelementbyidadding two number using javasciptadding variables jsfunction in js to add two numberssum two numbers javascript javascriptfunction add two numbers in javascriptadd 2 numbers in javascriptjavascript addition of two numbers domsum of two numbers in javascriptjavascript combine numbers how to add two numbers in node jsjavascript 2b adding numbersadd two numbers together javascriptto add 2 numbers using function in javascriptadd two integers javascripthow to add 2 integers in javascriptadd 2 number in jshow to addd two number in javascriptfunction to add 2 numbers in javascripthow to add in java scriptadd numbers javascripthow to add numbers in javascriptjavascript variable additionjavascript add to variablefunction statement javascript to add two numbersaddtion in javascriptadd two numbers in jshow to add two numbers in javascript in htmladd to numbers in javascriptsumm two var es5 javascriptadding two variables in javascriptjavascript addition var and intjavascript how to add two numbersjavascript to add two integers using javascriptjavascript addition functionadd two digit integer javascriptjavascript addition of two variablesplus in javascriptadd two variables in javascripttwo loops js add numbershow to add after two numbers in javascriptjavascript var plus same varjavascript code to add two numadding variables javascripthow to add two numbers that become string in javascriptadding two digit numbers javascriptadd up two numbers with function in javascriptaddition of two numbers html using javascriptjavascript or in number assignmenthow to concatenate two numbers in javascriptaddition two int variables javascriptfunction sum 2 numbers javacriptjavascript add two numbersjavascript function sum two numbersfunction addition 2 nombre en javascriptadding to a variable javascript 3d 2b and 2b 2b 3d 2b 1 jshow to add up the numbers from a single number in javascriptjavascript code for adding 2 numberscheck if number between two numbers javascriptadd 2 numbers in jshow to add 3ca 3e in javascriptjavascript sum operatoradd 2f in javascriptjs why add a to variablesaddition of two numbers in jsadding in jsnode js a function that adds two numbersadd number in jsnode js program to add two numbersjavascript to add numbers 3e 21 jsaddition of two numbers using function in javascriptreturn sum of two numbers in javascriptnode js add two numbersfunction sum 2 numbers javascriptjavascript how to add numberspossible ways of adding 2 numbers in jshow to generate multiple numbers in javascript all javascript additionsaddition javascripthow to add to numbers together in jsadd up two numbers in java scripthow to add ve value in javascriptconcat 2 numbers javascripthow to add a varjavascript add two numbers functionaddition of number in javascriptadd of two numbers in javascript 2b 3d number javascriptcreate a function which adds 2 numbers in javascripthow to add 2 variable using domadd two value in jshow to add 2 numbers together using math 28 29 in javascriptadd two number in jshow to add 22 in jswrite a simple javascript function to add 2 numbers how to make increments of two numbers javascriptsum of two number using function in javascriptjavascript adding two variablesadd two digits javascriptsum two numbers in javascriptadd two numbers javascriptaddition of two values in javascriptadd two numberse javascripthow to attach 3 numbers in javascriptadd two numbers using function in javascript functionjavascript function to add two numbershow to make javascript add numbers togetherhow to add two numbers in javascript using functionsadd same value javascript 2b 3dconcatenate two numbers javascriptreasign js sumjavascript plus numberadding 2 numbers in js using domaddition of two numbers in javascript using functionshow to add two number using jsjavascript operatorsjavascript adding two variables togetherhow to creare a script for adding in javascript between two numbersjavascript function to add two numbers