answersLogoWhite

0

input="yes"

while [[ $input = "yes" ]]

do

echo "------------"

echo "Calculator"

echo "------------"

PS3="Press 1 for Addition, 2 for subtraction, 3 for multiplication and 4 for division: "

select math in Addition Subtraction Multiplication Division

do

case "$math" in

Addition)

echo "Enter first no:"

read num1

echo "Enter second no:"

read num2

result=<code>expr $num1 + $num2</code>

echo Answer: $result

break

;;

Subtraction)

echo "Enter first no:"

read num1

echo "Enter second no:"

read num2

result=<code>expr $num1 - $num2</code>

echo Answer: $result

break

;;

Multiplication)

echo "Enter first no:"

read num1

echo "Enter second no:"

read num2

result=<code>expr $num1 \* $num2</code>

echo Answer: $result

break

;;

Division)

echo "Enter first no:"

read num1

echo "Enter second no:"

read num2

result=$(expr "scale=2; $num1/$num2" | bc)

echo Answer = $result

break

;;

*)

echo Choose 1 to 4 only!!!!

break

;;

esac

done

echo "Do you want to calculate again(yes/no):"

read input

echo "Thank you for using this program"

done

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What are the 4 basic maths symbols?

Addition (+), Substraction (-), Division ( / ), and Multiplication ( x ).


What is the order of operations for solving math equations?

Parentheses Exponents Multiplication Division Addition Substraction


What is the definition of standard algorithm?

The definition of "standard algorithm" is that it is a mathematical method used to solve problems such as addition, substraction, division, and multiplication.


How would 2 pond 60 be shown on a calculator display?

The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).


Function of abacus?

An abacus is an ancient form of the modern day calculator.


Is multiplication before division in order of operations?

"Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction." Therefore multiplication and division are equal.


The reverse of multiplication is?

Division


Subtraction is a form of addition and division is a form of multiplication give as example?

nope. Multiplication is a form of addition. Division is a form of subtraction.


What are the fundamental operation of math?

the fundamental operations in math are, addition +, subtraction -, division /,and multiplication x ..


What is the difference between the inverse of addition and the inverse of multiplication?

the inverse of addition is subtraction and the inverse of multiplication is division. Of course, multiplication is just repeated addition so division is just repeated subtraction!


What are advantages using calculator in teaching mathematics lesson?

Depending on the complexity of the calculation, a calculator can provide accurate answers more quickly.


What is a set of related addition-subtraction or multiplication-division sentences?

A set of related addition-subtraction or multiplication-division sentences is a fact family.