Math Expression

With Javascript, you can use math expressions like +, -, *, /, % etc.

Code Structure
var num1 = 10;
var num2 = 10;

// for addition
var total = num1 + num2; 

// for multiplication  
var total = num1 * num2;  

// for substraction 
var total = num1 - num2;

alert(total);
Note: You can follow the same procedure to other math expression.

Share this

Related Posts