Math Operators

Arithmetic Operators

PHP calculations

// Store two numbers and calculate six arithmetic results.
Operator Result Explanation
+ — Addition 20 Adds two numbers
- — Subtraction 6 Subtracts the second number from the first
* — Multiplication 91 Multiplies the numbers
/ — Division 1.8571428571429 Divides the first number by the second
% — Modulus 6 Returns the integer remainder after division
** — Exponentiation 62748517 Raises the first number to the second number’s power

Return to Activity 3 index