Friday, 26 May 2023

Write a shell script to perform addition, subtraction, multiplication and division operations on two given numbers.

 CODE


echo "Enter Two Integer Numbers ::"

read n1 n2

sum=`expr $n1 + $n2`

sub=`expr $n1 - $n2`

mul=`expr $n1 \* $n2`

div=`expr $n1 / $n2`

echo "Addition :" $sum

echo "Subtraction :" $sub

echo "Multiplication :" $mul

echo "Division ::" $div

No comments:

Post a Comment