Write a PHP program to check if it is possible to add two integers to get the third integer from three given integers
<?php function test($x, $y, $z) { return $x == $y + $z || $y == $x + $z || $z == $x + $y; } var_dump(test(1, 2, 3))."\n"; var_dump(test(4, 5, 6))."\n"; var_dump(test(-1, 1, 0))."\n";
Sample Output:
bool(true) bool(false) bool(true)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer