0
0
PHPprogramming~5 mins

Arithmetic operators in PHP - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the '+' operator do in PHP?
The '+' operator adds two numbers together. For example, 3 + 2 equals 5.
Click to reveal answer
beginner
What is the result of 10 - 4 in PHP?
The result is 6 because the '-' operator subtracts the right number from the left number.
Click to reveal answer
beginner
How does the '*' operator work in PHP?
The '*' operator multiplies two numbers. For example, 5 * 3 equals 15.
Click to reveal answer
beginner
What does the '/' operator do in PHP?
The '/' operator divides the left number by the right number. For example, 10 / 2 equals 5.
Click to reveal answer
beginner
What is the '%' operator used for in PHP?
The '%' operator finds the remainder after division of one number by another. For example, 7 % 3 equals 1.
Click to reveal answer
What is the result of 8 + 2 * 3 in PHP?
A24
B30
C18
D14
Which operator gives the remainder of a division in PHP?
A%
B+
C*
D-
What is the output of 15 / 4 in PHP?
A3
B3.75
C4
D1
What does the expression 5 - 10 evaluate to in PHP?
A5
B15
C-5
D10
Which operator has the highest precedence in PHP among these?
A*
B-
C+
D%
Explain how the basic arithmetic operators work in PHP and give an example for each.
Think about how you do math with numbers and how PHP uses symbols for these.
You got /6 concepts.
    Describe the order of operations when using multiple arithmetic operators in a PHP expression.
    Remember the math rule PEMDAS or BODMAS.
    You got /3 concepts.