Ost Perl, PHP PGMS
Ost Perl, PHP PGMS
RESULT:
The above program is executed successfully and the output is verified.
RESULT:
The above program is executed successfully and the output is verified.
EX.NO.:3A Finding the Largest and Smallest numbers in an array
using PHP
PROGRAM:
<?php
$arr= explode(' ', readline("Enter an array of values in a single line: "));
print_r($arr);
$max=max($arr);
$min=min($arr);
echo "The Largest number of the array is: ",$max,"\n" ;
echo " The Smallest number of the array is: ",$min;
?>
RESULT:
The above program is executed successfully and the output is verified.
PROGRAM:
// Print the days of the week using PHP
<?php
$day=readline("Enter a number for a day : ");
switch ($day)
{
case 1:
echo "Sunday";
break;
case 2:
echo "Monday";
break;
case 3:
echo "Tuesday";
break;
case 4:
echo "Wednesday";
break;
case 5:
echo "Thursday";
break;
case 6:
echo "Friday";
break;
case 7:
echo "Saturday";
break;
default:
echo "Enter a number between 1 and 7";
}
?>
RESULT:
The above program is executed successfully and the output is verified.