You are on page 1of 2

/* University Reg.

No: JEC20CS052
Program Name: Largest of Three Numbers using Shell Programming */

PROGRAM:
echo "Enter first number:"
read num1
echo "Enter second number:"
read num2
echo "Enter third number:"
read num3
if [ $num1 -gt $num2 ]
then
if [ $num1 -gt $num3 ]
then
echo "$num1 is the largest"
else
echo "$num3 is the largest"
fi
else
if [ $num2 -gt $num3 ]
then
echo "$num2 is the largest"
else
echo "$num3 is the largest"
fi
fi
OUTPUT:

You might also like