Write a PHP program to compute the sum of the two given integers. If one of the given integer value is in the range 10..20 inclusive return 18
<?php function test($x, $y) { return ($x >= 10 && $x <= 20) || ($y >= 10 && $y <= 20) ? 18 : $x + $y; } echo test(3, 7)."\n"; echo test(10, 11)."\n"; echo test(10, 20)."\n"; echo test(21, 220)."\n";
Sample Output:
10 18 18 241
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