Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i=1
- echo "--------------------"
- echo "Enter the Values A And B"
- echo "--------------------"
- while [ $i=1 ]
- do
- echo "Enter Value A :"
- read a
- echo "--------------------"
- echo "Enter Value B :"
- read b
- echo "--------------------"
- echo "--------------------"
- echo "1. Addition"
- echo "2. Subtarction"
- echo "3. Multiplcation"
- echo "4. Divsion"
- echo "--------------------"
- echo "Enter Your Option :"
- read ch
- case $ch in
- 1) echo "Addition"
- c=$(echo "scale=2;$a + $b"|bc)
- echo "--------------------"
- echo "Addition is : "$c
- echo "--------------------"
- ;;
- 2) echo "Subtraction"
- c=$(echo "scale=2;$a - $b"|bc)
- echo "--------------------"
- echo "Subtraction is : "$c
- echo "--------------------"
- ;;
- 3)echo "Multiplcation"
- c=$(echo "scale=2;$a * $b"|bc)
- echo "--------------------"
- echo "Multiplcatio is : "$c
- echo "--------------------"
- ;;
- 4)echo "Divsion"
- c=$(echo "scale=2;$a / $b"|bc)
- echo "--------------------"
- echo "Divsion is : "$c
- echo "--------------------"
- ;;
- *) echo "Please enter some option"
- ;;
- esac
- echo "Enter 2 to Exit :"
- read i
- if [ $i -ne 1 ]
- then
- exit
- fi
- done
Add Comment
Please, Sign In to add comment