Shell Script Program To Find Addition Of Three Numbers

add()
{

x=$1
y=$2
z=$3

a=`expr $x + $y`

echo -e "Number entered by u are: $x , $y and $z"

echo "sum of $1 , $2 and $3 is `expr $a + $z`"

}

echo "enter first number"
read first

echo "enter second number"
read sec

echo "enter third number"
read third

add $first $sec $third

echo "this is the end of the program"

One thought on “Shell Script Program To Find Addition Of Three Numbers

Leave a reply to Kishan Aggarwal Cancel reply