JAVASCRIPT Tutorial
Arithmetic operators are used to perform mathematical operations on numbers. The five basic arithmetic operators are:
5 + 10 = 15
10 - 5 = 5
5 * 10 = 50
10 / 5 = 2
10 % 5 = 0
// addition
const num1 = 5;
const num2 = 10;
const sum = num1 + num2;
console.log(sum); // output: 15
// subtraction
const num3 = 10;
const num4 = 5;
const difference = num3 - num4;
console.log(difference); // output: 5
// multiplication
const num5 = 5;
const num6 = 10;
const product = num5 * num6;
console.log(product); // output: 50
// division
const num7 = 10;
const num8 = 5;
const quotient = num7 / num8;
console.log(quotient); // output: 2
// modulo
const num9 = 10;
const num10 = 5;
const remainder = num9 % num10;
console.log(remainder); // output: 0