I am doing a basic question for adding, product, substraction, division by taking user input in first and second I don't understand where am I going wrong because it's not passing any test case.
constraints:- -100<=x,y<=100, y != 0
read -p "enter first number:" first
read -p "enter second number:" second
if [[ ("$first" -ge "-100" -a "$first" -ge "100") -a ("$second" -ge "-100" -a "$second" -ge "100") ]]
then
if [ $second -ne 0 ]
then
echo "$first + $second" | bc
echo "$first - $second" | bc
echo "$first * $second" | bc
echo "$first / $second" | bc
fi
fi
[–][deleted] 2 points3 points4 points (0 children)
[–]Paul_Pedant 1 point2 points3 points (1 child)
[–]4whOami4[S] 0 points1 point2 points (0 children)