Arithmetic Operators

๐Ÿ‘จโ€๐Ÿ’ผ We need to perform calculations in our programs. JavaScript provides arithmetic operators for basic math operations.
The arithmetic operators are:
  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • % Modulo (remainder after division)
๐Ÿจ Open and:
  1. Create variables a and b with any two numbers
  2. Calculate and log the sum (a + b)
  3. Calculate and log the difference (a - b)
  4. Calculate and log the product (a * b)
  5. Calculate and log the quotient (a / b)
  6. Calculate and log the remainder (a % b)
๐Ÿ’ฐ Example:
console.log('Sum:', 10 + 5) // 15
console.log('Remainder:', 10 % 3) // 1 (10 รท 3 = 3 remainder 1)

Please set the playground first

Loading "Arithmetic Operators"
Loading "Arithmetic Operators"
Login to get access to the exclusive discord channel.