Hello coders, In this post, you will learn how to solve the Arithmetic Operations HackerRank Solution. This problem is a part of the Linux Shell series.
A mathematical expression containing +,-,*,^, / and parenthesis will be provided. Read in the expression, then evaluate it. Display the result rounded to 3 decimal places.
All numeric values are <= 999.
Sample Input 1
5+503/20 + (192)/7
Sample Input 2
-105+50*3/20 + (19^2)/7
Sample Input 3
(-105.57+503)/20 + (19^2)/7
Sample Output 1
Sample Output 2
Sample Output 3
Arithmetic Operations HackerRank Solution
read x printf "%.3f\n" `echo "$x" | bc -l`
Note: This problem (Arithmetic Operations) is generated by HackerRank but the solution is provided by chase2learn. This tutorial is only for Learning and Educational purpose.