title: Why does my program reach end of file when I input larger numbers?
body: <pre><code>int main()
  {
      int sum = 0, value = 0;
      while (std::cin &gt;&gt; value)
          sum += value;
      std::cout &lt;&lt; "Sum is: " &lt;&lt; sum &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>So this code takes values from the user and adds them. I don't understand what makes it reach end of file. I tested it multiple times and found that when I use larger numbers (9999999999) it ends faster, but when I put in just 1s it never ends.</p>