The World of Numbers

Sort by

recency

|

188 Discussions

|

  • + 0 comments
    #!/bin/bash
    
    read X
    read Y
    
    echo "$(($X + $Y))"
    echo "$(($X - $Y))"
    echo "$(($X * $Y))"
    echo "$(($X / $Y))"
    
  • + 0 comments

    Very Short Solution read n1 read n2 echo ((n1-n2)) echo ((n1/n2))

  • + 0 comments

    read n1 read n2 echo ((n1-n2)) echo ((n1/n2))

  • + 0 comments
    #!/bin/bash
    read a
    read b
    if ([ "$a" -ge "-100" ] || [ "$a" -le "100" ] && [ "$b" -ge "-100" ] || ["$b" -le "100"] && [ "$b" != "0" ]);
    then
    for op in "+" "-" "*" "/"
    do
    echo $((a $op b))
    done
    fi
    

    What do you think?

  • + 0 comments
    read number1
    read number2
    echo $((number1+number2))
    echo $((number1-number2))
    echo $((number1*number2))
    echo $((number1/number2))