Linux program to find the greatest number among three, maximum number, find the maximum, user input,

http://www.knowsh.com > Notes > Linux > Linux program to find the greatest number among three
Priya Linux program to find the greatest number among three Linux program to find the greatest number among three.

Linux program to find the greatest number among three

Linux program to find the greatest number among three

Linux program to find the greatest number among three (Linux)

Introduction (Descriptive)

Linux program to find the greatest number among three.

Details

#Biggest of three no.s
echo "Enter 3 no.s"
read a b c
if [ $a -gt $b ]
then
  if [ $a -gt $c ]
  then
    echo "$a is greatest"
  else
    echo "$c is greatest"
  fi
else
  if [ $b -gt $c ]
  then
    echo "$b is greatest"
  else
    echo "$c is greatest"
  fi
fi

 


About knowsh.com

We are tring to provide a common plateform to the students and professionals to share their knowledge among others because knowledge is the only thing that increase when it is shared.

Contact links