title: Returning array from function (Syntax Error: Value expected)
body: <p>Why does the program expect me to return <code>array[c]</code> in the below code when <code>c</code> is the length of array minus 1? I can't seem to follow how my program still manages to execute just well.</p>
  
  <p>P.S I arrived at the last line of code by Trial and Error and it worked as expected. I just don't know how!</p>
  
  <pre><code> public static int arrayReverse(int[] array)
          {
              int c = array.Length - 1, b;
              for (int i = 0; i &lt; (array.Length / 2); i++)
              {
                  b = array[i];
                  array[i] = array[c];
                  array[c] = b;
                  c--;
              }
              return array[c];
          }
  </code></pre>
  
  <p>My main function looks like this:</p>
  
  <pre><code> static void Main(string[] args)
          {
              int[] array = new int[] { 1, 5, 3, 4, 2 };
             //Reverse an Array
              arrayReverse(array);
             //Display Array Elements
              foreach (int x in array)
                  Console.WriteLine(x);
              Console.ReadLine();
          }
  </code></pre>