title: Using a for loop to reverse an array does nothing
body: <p>I am trying to reverse an array of 15 numbers by using a for loop, but for some reason the array order stays the same.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>int main()
  {
      int arr[15] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
      int i, j, temp;
      for (i = 0; i &lt; 15; i++)
      {
          temp = arr[15 - i - 1];
          arr[15 - i - 1] = arr[i];
          arr[i] = temp;
      }
      j = 0;
      do {
          std::cout &lt;&lt; arr[j] &lt;&lt; " ";
          j++;
      } while (j &lt; 15);
  }
  </code></pre>
  
  <p>Any idea what have I done wrong?</p>