You are viewing a single comment's thread. Return to all comments →
read N counter=$N sum=0 while ((counter-- > 0)); do read number; ((sum+=$number)) done printf "%.3f" "$(echo "$sum / $N" | bc -l)"
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Average
You are viewing a single comment's thread. Return to all comments →