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 »

Still not found what you are looking for? Try again here.