You are viewing a single comment's thread. Return to all comments →
read N result=0 for ((i=0; i < N; i++)); do read number result=$(echo "$result + $number" | bc) done avg=$(echo "$result / $N" | bc -l) printf "%0.3f" "$avg"
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 →