Ad
  • Default User Avatar

    I'm a beginner and trying to learn multiple solutions to different problems.

    When I run this code with a negative number, it doesn't return 0 so there must be something about it I don't understand.

    Can someone explain how this meets the requirements of the prompt if it doesn't return 0 for a negative number? Or is there something about this code that doesn't work when I run it in an environment like OneCompiler?