Shell Script to Find Greatest of Three Numbers

In this tutorial, You'll learn shell script to find greatest of three numbers. In this shell programming, based on basic control structure like if-else. 

Shell Script to Find Greatest of Three Numbers

echo "Enter Num1"
read num1
echo "Enter Num2"
read num2
echo "Enter Num3"
read num3
if [ $num1 -gt $num2 ] && [ $num1 -gt $num3 ]
then
echo $num1
elif [ $num2 -gt $num1 ] && [ $num2 -gt $num3 ]
then
echo $num2
else
echo $num3
fi
Above You'll learn shell script to find greatest of three numbers. I hope you enjoy this.

Happy Coding 😊

If you have any doubts, Please let me know

Previous Post Next Post

Contact Form