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

Write a Shellscript to find sum of three given numbers

CODE


 n1=10

n2=20

n3=15

sum=`expr $n1 + $n2 + $n3`

echo " SUM = " $sum