RosettaCodeData/Task/Arithmetic-Integer/PHP/arithmetic-integer.php

13 lines
331 B
PHP
Raw Normal View History

2013-04-10 15:42:53 -07:00
<?php
$a = fgets(STDIN);
$b = fgets(STDIN);
echo
"sum: ", $a + $b, "\n",
"difference: ", $a - $b, "\n",
"product: ", $a * $b, "\n",
"truncating quotient: ", (int)($a / $b), "\n",
"flooring quotient: ", floor($a / $b), "\n",
"remainder: ", $a % $b, "\n";
?>