echo "Enter first number :-"
read num1
echo "Enter second number :-"
read num2
ans=`expr $num1 + $num2`
echo "Addition is : $ans"
ans=`expr $num1 - $num2`
echo "Substraction is : $ans"
ans=`expr $num1 \* $num2`
echo "Multiplication is : $ans"
ans=`expr $num1 / $num2`
echo "Division is : $ans"
ans=`expr $num1 % $num2`
echo "Modulus is : $ans"
Sunday, 29 October 2017
Shell Script Arithmetic Operations
Subscribe to:
Post Comments (Atom)
No comments:
Write comments