The World of Numbers

Sort by

recency

|

205 Discussions

|

  • + 0 comments

    !/bin/bash read x read y echo ((x-y)) echo ((x/y))

  • + 0 comments

    !/bin/bash

    calc_numbers () { read x read y

    echo $((x + y))
    echo $((x - y))
    echo $((x * y))
    echo $((x / y)) 
    

    }

    calc_numbers

  • + 0 comments
    read X
    read Y
    
    echo "$(($X+$Y))"
    echo "$(($X-$Y))"
    echo "$(($X*$Y))"
    echo "$(($X/$Y))"
    
  • + 0 comments

    !/bin/bash

    X=5 Y=2

    sum=exprY echo $sum

    difference=exprY echo $difference

    product=exprY echo $product

    quotient=exprY echo $quotient

  • + 0 comments
    # !/bin/bash
    
    read x
    read y
    echo $((x+y))
    echo $((x-y))
    echo $((x*y))
    if [[ $y -ne 0 ]]; then
        echo $((x/y))
    fi;