title: Reverse Contents in Array
body: <p>I have an array of numbers that I am trying to reverse. I believe the function in my code is correct, but I cannot get the proper output.</p>
  
  <p>The output reads: 10 9 8 7 6.
  Why can't I get the other half of the numbers? When I remove the "/2" from count, the output reads: 10 9 8 7 6 6 7 8 9 10</p>
  
  <pre><code>void reverse(int [], int);
  
  int main ()
  {
     const int SIZE = 10;
     int arr [SIZE] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  
     reverse(arr, SIZE);
     return 0;
  }
  void reverse(int arr[], int count)
  {
     int temp;
     for (int i = 0; i &lt; count/2; ++i)
     {
        arr[i] = temp;
        temp = arr[count-i-1];
        arr[count-i-1] = arr[i];
        arr[i] = temp;
  
        cout &lt;&lt; temp &lt;&lt; " ";
     }
  }
  </code></pre>