Write a PHP program to check if two or more non-negative given integers have the same rightmost digit
<?php function test($x, $y, $z) { return $x % 10 == $y % 10 || $x % 10 == $z % 10 || $y % 10 == $z % 10; } var_dump(test(11, 21, 31))."\n"; var_dump(test(11, 22, 31))."\n"; var_dump(test(11, 22, 33))."\n";
Sample Output:
bool(true) bool(true) bool(false)
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