GREATEST AMONG THREE NUMBERS

SOURCE CODE:
echo " Enter A value: "
read a
echo " Enter B value: "
read b
echo " Enter C value: "
read c
if [ $a -gt $b ] && [ $a -gt $c ]
then
echo "A value is greater"
elif [ $b -gt $a ] && [ $b -gt $c ]
then
echo "B value is greatest "
else
echo "C value is greatest "
fi

OUTPUT:
[examuser35@localhost Jebastin]$ sh greatest.sh
Enter A value:
5
Enter B value:
6
Enter C value:
2
B value is greatest
Previous
Next Post »

If you still didn't find what you're looking for, you can search this website below: