You are viewing a single comment's thread. Return to all comments →
read n i=0 sum=0 while [ n ] do read num sum=exprnum i=expr $i + 1 done echo "scale=3 ; n" | bc -l
expr
num
expr $i + 1
I can't figure out why is it failing one test case?
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 →
read n i=0 sum=0 while [ n ] do read num sum=
expr
num
i=expr $i + 1
done echo "scale=3 ; n" | bc -lI can't figure out why is it failing one test case?