Basic Arithmetic Operators in javascript
In javascript we can do ordinary arithmetic operation such as addition, subtraction, multiplication, division.
Symbol | Name | Description | Example |
---|---|---|---|
+
|
Plus | Used for addition operation. | Try |
-
|
Minus | Used for subtraction operation | Try |
*
|
Multiply | Used for multiplication operation. | Try |
/
|
Divide | Used for division operation | Try |
Addition operation in javascript
In this example two variables a and b are created and values are assigned(30,10). These two values are added using + symbol and the resultant value is stored in variable c and displayed.
Subtraction operation in javascript
In this example two variables a and b are created and values are assigned(30,10). These two values are subtracted using - symbol and the resultant value is stored in variable c and displayed.
Multiplication operation in javascript
In this example two variables a and b are created and values are assigned(30,10). These two values are multiplied using * symbol and the resultant value is stored in variable c and displayed.
Division operation in javascript
In this example two variables a and b are created and values are assigned(30,10). These two values are divided using / symbol and the resultant value is stored in variable c and displayed.