Q:

Write a PHP program to check the largest number among three given integers

0

Write a PHP program to check the largest number among three given integers

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
function test($x, $y, $z) 
{
  $max = max($x, max($y, $z));
  return $max;
}

echo test(1, 2, 3)."\n";
echo test(1, 3, 2)."\n";
echo test(1, 1, 1)."\n";
echo test(1, 2, 2)."\n"
Sample Output:
3
3
1
2

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now