Source Code:
(back to article)
<?php $num1 = 10; $num2 = 5; // Addition $result = $num1 + $num2; echo "\$num1 + \$num2 = "; echo $result; // 15 // Subtraction $result = $num1 - $num2; echo "\n\$num1 - \$num2 = "; echo $result; // 5 // Multiplication $result = $num1 * $num2; echo "\n\$num1 * \$num2 = "; echo $result; // 50 // Division $result = $num1 / $num2; echo "\n\$num1 / \$num2 = "; echo $result; // 2 // Modulus $result = $num1 % $num2; echo "\n\$num1 % \$num2 = "; echo $result; // 0 ?>
Result:
Report an issue