title: Not getting correct expected output on diceroll
body: <p>I am currently working on this program to roll 2 dice. My program works however, for some reason my expected output is coming out as 0.000% for all roll sums instead of what it should be. I am sure I am overlooking something but I have no idea what. Any help is much appreciated!</p>
  <p><a href="https://i.stack.imgur.com/2B5F5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2B5F5.jpg" alt="Current Expected" /></a></p>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;ctime&gt;
  #include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
  const int ROLLS = 36000;
  const int SIZE  = 13;
  const int CW    = 10;
  
  // array 'expected' contains counts for the expected number of times
  // each sum occurs in 36 rolls
  
  int expected[SIZE]= {0,0,1/36,1/18,1/12,1/9,5/36,1/6,5/36,1/9,1/12,1/18,1/36};
  
  int sum [SIZE] = {0};
  
  int die1;
  int die2;
  
  srand(static_cast&lt;unsigned&gt;(time(nullptr)));
  
  for (int i = 0; i &lt;=ROLLS; ++i) {
      die1 = 1 + rand() % 6;
      die2 = 1 + rand() % 6;
      sum[die1+die2]++;
  }
  
  cout &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; setprecision(3);
  
  cout &lt;&lt; setw(CW) &lt;&lt; &quot;Sum&quot; &lt;&lt; setw(CW) &lt;&lt; &quot;Total&quot;
       &lt;&lt; setw(CW) &lt;&lt; &quot;Expected&quot; &lt;&lt; setw(CW) &lt;&lt; &quot;Actual&quot; &lt;&lt; endl;
  
  for (int j = 2; j &lt; SIZE; ++j) {
      cout &lt;&lt; setw(CW) &lt;&lt; j &lt;&lt; setw(CW) &lt;&lt; sum[j]
           &lt;&lt; setw(CW-1) &lt;&lt; (100.0 * expected[j] / 36) &lt;&lt; '%'
           &lt;&lt; setw(CW-1) &lt;&lt; (100.0 * sum[j] / ROLLS) &lt;&lt; '%' &lt;&lt; endl;
  }
  
  return 0;
  }
  </code></pre>