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                      

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart