The World of Numbers

Sort by

recency

|

193 Discussions

|

  • + 0 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"

  • + 0 comments

    read X read Y echo [X - Y] echo [X / Y]

  • + 0 comments

    read X read Y

    echo X + ((Y)) echo X * ((Y))

  • + 0 comments

    read -p 5 X read -p 2 Y

    sum=((X-Y)) product=((X/Y))

    echo "difference" echo "quotient"

  • + 0 comments

    read x read y echo ((x-y)) echo ((x/y))