PHP program to enter two numbers and find their sum
ADVERTISEMENTS
PHP program to the sum of two integers
<?php
// PHP program to the sum of two integers
$p = 5;
$q = 7;
$r = $p + $q;
echo "\nResult:: " . $p . " + " . $q . " = " . $r;
?>
Output:
Result:: 5 + 7 = 12
PHP program to the sum of two integer values with minimum variables
<?php
// PHP program to the sum of two integer values with minimum variables
$p = 5;
$q = 7;
echo "\nResult:: " . $p . " + " . $q . " = ";
$p = $p + $q;
echo $p;
?>
Output:
Result:: 5 + 7 = 12