Compute the Average

  • + 0 comments

    sum=0 read N

    for (( i=1; i<=N; i++)) do read x ((sum += x)) done avg=sum / avg"