title: C++ For Loop. Int. values are not being summed correctly
body: <p>Beginner here. So I'm trying to get this code to print the total value for each year. I've entered 10 for every value and for year 3 it returns 126 while I expect 120. The other two years return the correct value 120. I'm having trouble figuring out why this isn't working as intended.</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main()
  {
      using namespace std;
      const int Years = 3;
      const int Months = 12;
      int booksales[Years][Months];
      int total[3];
      for (int year = 0; year &lt; Years; ++year)
      {
          int yr_total = 0;
          for (int month = 0; month &lt; Months; ++month)
          {
              cout &lt;&lt; "Enter book sales for year " &lt;&lt; (year + 1)
              &lt;&lt; " month " &lt;&lt; (month + 1) &lt;&lt; ": ";
              cin &gt;&gt; booksales[year][month];
              total[year] += booksales[year][month];
          }
       }
  cout &lt;&lt; "TOTAL for year 1: " &lt;&lt; total[0] &lt;&lt; endl;
  cout &lt;&lt; "TOTAL for year 2: " &lt;&lt; total[1] &lt;&lt; endl;
  cout &lt;&lt; "TOTAL for year 3: " &lt;&lt; total[2] &lt;&lt; endl;
  cout &lt;&lt; "OVERALL TOTAL: " &lt;&lt; total[0] + total[1] + total[2] &lt;&lt; endl;
  return 0;
  }
  </code></pre>