Assignment 1

Barry Molina

Math

PHP can be used to perform common math operations.

Addition uses the + operator

echo 5 + 6;

Output: 11

Subtraction uses the - operator

echo 76 - 6;

Output: 70

Multiplication uses the * operator

echo 7 * 8;

Output: 56

Division uses the / operator

echo 25 / 5;

Output: 5

The modulo operator % finds the integer division remainder

echo 17 % 3;

Output: 2

math.php source code screenshot