DWPD-2.7: Write PHP Script to find maximum number out of three given numbers.

dwpd lab 2.7
Lab # 2
Basics of PHP


7. Write PHP Script to find maximum number out of three given numbers.

Lab-2-7-max-out-of-three.php

<?php
    $num1=50;
$num2=40;
$num3=20;
if($num1>$num2 and $num1>$num3)
{
echo "Max is $num1";
}
else if($num2>$num3)
{
echo "Max is $num2";
}
else
{
echo "Max is $num3";
}
?>


Output

dwpd lab 2-7 output
Maximum number out of three by Practical Server


Happy Coding 🙂

Leave a comment