Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Shell Scripting Tutorials: Function


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 $?
Code language: PHP (php)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals

Similar Posts

Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
rakesh
rakesh
2 years ago

thanks for sharing shell scripting blogs. keep writing blogs that helps no of software developer