We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Linux Shell
  3. Bash
  4. The World of Numbers
  5. Discussions

The World of Numbers

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

Sort 159 Discussions, By:

recency

Please Login in order to post a comment

  • matthewgin10
    6 hours ago+ 0 comments
    read x
    read y
    
    echo $(($x + $y))
    echo $(($x - $y))
    echo $(($x * $y))
    echo $(($x / $y))
    
    0|
    Permalink
  • jagupatigolguri
    3 weeks ago+ 0 comments

    read a; read b;

    echo ((a - b)); echo ((a / b));

    0|
    Permalink
  • oonerique
    4 weeks ago+ 0 comments
    read x
    read y
    
    if (($x<-100)) && (($x>100)) || (($y<-100)) && (($y>100))
    then
     echo "over range"
     exit 1
    else
        #Sum
        echo $(($x+$y))
        #difference
        echo $(($x-$y))
        #product
        echo $(($x*$y))
        #quotient
        echo $(($x/$y))
    fi
    
    0|
    Permalink
  • venkatadeepikat1
    4 weeks ago+ 1 comment

    read x; read y; echo x+((y)); echo x*((y));

    0|
    Permalink
  • wojciech_galan
    1 month ago+ 2 comments

    For some reason this code works in my local terminal

    read x
    read y
    
    expr $x + $y
    expr $x - $y
    expr $x \* $y
    expr $x / $y
    

    But

    fails two test cases. Can anyone explain, why?

    0|
    Permalink
Load more conversations

Need Help?


View tutorial
View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy