Advertisement
shawonrog

2ndlargest number bash progrm lang

Jun 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. echo "Enter value of a : "
  2. read a
  3. echo "Enter value of b : "
  4. read b
  5. echo "Enter value of c : "
  6. read c
  7.  
  8. if [ $a -gt $b ]
  9.    then
  10.        if [ $a -gt $c ]
  11.            then
  12.            if [ $b -gt $c ]
  13.            then
  14.            echo "$b"
  15.            else
  16.            echo "$c"
  17.            fi
  18.        else
  19.        echo "$a"
  20.        fi
  21.  
  22. else
  23. if [ $b -gt $c ]
  24.    then
  25.        if [ $a -gt $c ]
  26.            then
  27.            echo "$a"
  28.            else
  29.            echo "$c"
  30.        fi
  31.     else
  32.     echo "$b"
  33.     fi
  34. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement