Javascript arithmetic operators

Javascript provides lots of arithmetic operations to do. To execute various arithmetic operations, we use various arithmetic operators.

Addition Operator +

To perform addition operation we use addition operator.

Example: Lets print addition value of 5 and 10

<script>

alert(5+10);

</script>

The above code would print 15.

Multiplication operator *

To perform multiplication operation, we use multiplication operator.

Example: Lets print multiplication of 10 and 5.

<script>

alert(10*5);

</script>

The above code would print 50.

Division operator /

To perform division operation, we use division operator.

Example: Lets print division of 10 and 5.

<script>

alert(10/5);

</script>

The above code would print 2.

Modulus operator %

To perform modulus operation, we use modulus operator.

Example: Lets print modulus operation on 12 and 5.

<script>

alert(12%5);

</script>

The above code would print 2.