Why my computer can't find negative of -2147483648

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • A simple program that calculates negative of a number, however it fails miserable for a particular input!!! find out why.....

Комментарии • 2

  • @aravindvallabhaneni
    @aravindvallabhaneni 4 месяца назад +1

    i was asked this question in an exam, we had the same test case of -2^31 , so what i did was ti just took the input in long (java )🤡

    • @ayanarif1
      @ayanarif1  4 месяца назад

      Yeah that’s a safe bet !!!!