Wednesday, 19 June 2013

Write a shell script of greatest of three numbers?



echo " Enter three numbers:"
read a b c
if [ $a -gt $b -a $a -gt $c ]
then
echo "$a is greater"
elif [ $b -gt $c ]
then
echo "$b is greater"
else
echo "$c is greater"
fi                                   


OUTPUT :
           
Enter three numbers:
3
30
300

300 is greater                      

No comments:

Post a Comment