how to do addition in javascript 1

how to do addition in javascript

//To add in Java script, you have to put an additon symbol '+' between them. If you have stored two numbers in variables, just put an addition symbol between the variable names.
//For example:
var a = 5
var b = 6
var c = a+b
var d = 5+6

Bot.send (c)/ print (c)// or whatever you use to get output
Bot.send (d)/ print (d)// or whatever you use to get output

//output will be: 11, 11

Here is what the above code is Doing:
1. We are storing the number 5 in a variable called ‘a’
2. We are storing the number 6 in a variable called ‘b’
3. We are adding the numbers stored in ‘a’ and ‘b’ and storing the result in a variable called ‘c’
4. We are adding the numbers 5 and 6 and storing the result in a variable called ‘d’
5. We are printing the value stored in ‘c’
6. We are printing the value stored in ‘d’

Similar Posts