#
#Accept numbers and perform addition, subtraction, division and multiplication.
#
clear
echo "Enter first number :"
read number1
echo "Enter second number :"
read number2
echo "\n\n===== Available choices =====\n"
echo "A - Addition"
echo "S - Subtraction"
echo "D - Division"
echo "M - Multiplication"
echo "E - Exit"
echo "\n============================="
echo -n "\nEnter your choice :"
read choice
while [ $choice != 'e' -o $choice != 'E' ]
do
case $choice in
[aA] )
sum=`expr $number1 + $number2`
echo "Addition of two number is "$sum
;;
[sS] )
sub=`expr $number1 - $number2`
echo "Subtraction of two number is "$sub
;;
[dD] )
div=`expr $number1 / $number2`
echo "Division of two number is "$div
;;
[mM] )
mul=`expr $number1 \* $number2`
echo "Multiplication of two number is "$mul
;;
[eE] )
break;
;;
*)
echo "Invalid choice"
;;
esac
read temp
clear
echo "Numbers are :\n"
echo "Number1 = "$number1
echo "Number2 = "$number2
echo "\n\n===== Available choices =====\n"
echo "A - Addition"
echo "S - Subtraction"
echo "D - Division"
echo "M - Multiplication"
echo "E - Exit"
echo "\n=============================="
echo -n "\nEnter your choice :"
read choice
done