title: 2D array of Doubles returning 0
body: <p>I have this 2D array and I am checking the value at [5][5].  The value should be 1/11 or 0.0909 as a double.  The issue is that I am getting 0 as a return value.</p>
  
  <p>I am checking to make sure I have implemented the 2D array correctly. This is within main.</p>
  
  <pre><code>    //start clock
  clock_t time = clock();
  
  int n;
  
  printf("Please enter a value for n: ");
  
  //get n
  cin &gt;&gt; n;
  
  printf("\nn = %i \n", n);
  
  //allocate space for matrix A
  double **A_n = new double*[n];
  for (int k = 0; k &lt; n; ++k) {
      A_n[k] = new double[n];
  }
  
  for (int i = 1; i &lt;= n; ++i) {
      for (int j = 1; j &lt;= n; ++j) {
          A_n[i-1][j-1] = (double)(1/(i+j-1));
      }
  }
  
  //Test Matrix A_n
  printf("A_n[5][5] = %e \n", A_n[5][5]);
  </code></pre>