The World of Numbers

Sort by

recency

|

195 Discussions

|

  • + 0 comments

    !/bin/bash

    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 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))