Arithmetic Operators in PHP

Notes:

PHP Arithmetic Operators

+: Addition Operator : sum of two numbers
-: Subtraction Operator : difference between two numbers
*: Multiplication Operator : product of two numbers
/: Division Operator : quotient of a division operation
%: Modulus Operator : remainder of the first division operation
**: exponential Operator : raise to the power of

Example Code:
echo "Arithmetic operators" ,"<br/>";
echo 10 + 2, "<br/>"; // 12
echo 10 - 2, "<br/>"; // 8
echo 10 * 2, "<br/>"; // 20
echo 11 / 2, "<br/>"; // 5.5
echo 11 % 2, "<br/>"; // 1
echo 5 ** 2, "<br/>"; // 25
//echo 10 / 0, "<br/>"; // division by zero error
echo "2a" + "3a","<br/>"; // 5
echo "a2" + "3a","<br/>"; // 3

Interview Questions:

1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a