You are on page 1of 1

Menu based Program to perform basic calculations c=1 while [ $c -ne 6 ] do echo -e -n "\nOPTIONS:\n-------\n1.Add\t2.Sub\t3.Mul\t4.Div\t5.Max\t6.

Exit\nEnter your choice\t:\t" read c if [ $c -ne 6 ] then echo -e -n "\nEnter the first no\t:\t" read a echo -e -n "Enter the second no\t:\t" read b case $c in 1) echo "Sum is $[$a+$b]";; 2) echo "Difference is $[$a-$b]";; 3) echo "Product is $[$a*$b]";; 4) echo "Quotient is " echo $a/$b|bc -l;; 5) if [ $a -gt $b ] then echo -e "$a is maximum value" else echo -e "$b is maximum value" fi;; esac echo -e "Do you want to continue?\t1.Yes\t2.No" read t if [ $t -eq 2 ] then c=6 fi fi done

You might also like