codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $sum = 5; $product = 6; $found = FALSE; for ($a = 1; $a < $sum; $a++) { $b = $sum - $a; if ($a * $b == $product) { $found = TRUE; break; } } if ($found) { echo "The answer is a = $a, b = $b."; } else { echo "There is no answer where a and b are both integers."; }
Private
[
?
]
Run code
Submit