find_average()
{
sum=0
i=1
len=$#
x=$((len + 1))
while [ $i -lt $x ]
do
arg=${!i}
sum=$((sum + arg))
i=$((i + 1 ))
done
avg=$((sum / len))
return $avg
}
find_average 10 20 30 40
echo $?
Latest posts by Rajesh Kumar (see all)
- Atlassian Jira Demo - January 4, 2025
- Revolutionizing Business Management with Microsoft Business Central - January 4, 2025
- Key Benefits of Converting HTML to PDF File Format - January 2, 2025
thanks for sharing shell scripting blogs. keep writing blogs that helps no of software developer