Shell program - to find sum and average of three numbers

CODE:

#! /bin/bash

echo "enter three numbers"
read a
read b
read c
sum=`expr "$a" + "$b" + "$c"`
avg=`expr "$sum" \/ 3 ` 
echo "sum="$sum
echo "avg="$avg

OUTPUT:
Shell program - to find sum and average of three numbers

No comments :

Post a Comment