Friday, October 1, 2010

Arithmetic Operators in Php

The arithmetic operators do exactly what you would expect. Table 4.2 lists these
operators. The addition operator adds the right operand to the left operand. The
subtraction operator subtracts the right-hand operand from the left. The division
operator divides the left-hand operand by the right. The multiplication operator
multiplies the left-hand operand by the right. The modulus operator returns the
remainder of the left operand divided by the right.


Operator Name    Example      Example Result
+       Addition          10+3                   13
−       Subtraction    10− 3                    7
/        Division           10/3         3.3333333333333
*      Multiplication    10*3                  30
%       Modulus        10%3                 1

No comments:

Post a Comment