Compute the Average – HackerRank Solution BASH, Best and Optimal Solutions , All you need.
Solutions of Algorithms Data Structures Hard HackerRank:
Here are all the Solutions of Hard , Advanced , Expert Algorithms of Data Structure of Hacker Rank , Leave a comment for similar posts
BASH Compute the Average HackerRank Solution
read N
S=0
C=0
while [ $C -lt $N ]; do
read A
S=$(($S+$A))
C=$(($C+1))
done
printf "%.3f" $(echo "$S / $N" | bc -l)
Bash
Text Processing
Arrays in Bash
Grep Sed Awk
Leave a comment below