Write a PHP program to check if one given temperatures is less than 0 and the other is greater than 100
<?php function test($temp1, $temp2) { return $temp1 < 0 && $temp2 > 100 || $temp2 < 0 && $temp1 > 100; } var_dump(test(120, -1)); var_dump(test(-1, 120)); var_dump(test(2, 120));
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