Monday, March 2, 2015

Arithmetic expression in unix

read n

num=`echo "scale = 4;$n" | bc -l`

printf "%.3f" $num

No comments:

Post a Comment