You are viewing a single comment's thread. Return to all comments →
(easy solution is here : and if you are fail in one test and pass 5 test it is because you are not useing %0.3f .else use this bigner code. :)
read n result=0 for((i=0;i<$n;i++)) do read num result=$(echo " $result + $num " |bc) done r=$(echo "$result / $n" | bc -l) printf "%0.3f" "$r"
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 →
(easy solution is here : and if you are fail in one test and pass 5 test it is because you are not useing %0.3f .else use this bigner code. :)