You are viewing a single comment's thread. Return to all comments →
read -p "Enter the first integer: " a read -p "Enter the second integer: " b
sum=((a - b)) prod=$((a * b))
if [ "((a / b)) else quot="Undefined (division by zero)" fi
echo "diff" echo "quot"
Seems like cookies are disabled on this browser, please enable them to open this website
The World of Numbers
You are viewing a single comment's thread. Return to all comments →
Read two integers from the user
read -p "Enter the first integer: " a read -p "Enter the second integer: " b
Perform calculations
sum=((a - b)) prod=$((a * b))
Handle division by zero
if [ "((a / b)) else quot="Undefined (division by zero)" fi
Display results
echo "diff" echo "quot"