What is the command in shell terminal to find the total average of 3 grades?

1 answer

Answer

1056899

2026-04-30 06:00

+ Follow

To calculate the total average of three grades in a shell terminal, you can use the following command:

<code class="language-bash">echo "scale=2; ($grade1 + $grade2 + $grade3) / 3" | bc
</code>

Replace $grade1, $grade2, and $grade3 with the actual grade values. The scale=2 sets the output to two decimal places, and bc is a calculator tool used for floating-point arithmetic.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.