title: Order an array in a specific order
body: <p>I have this array of integers:-</p>
  
  <pre><code>int[] numbers = new int[] { 10, 20, 30, 40 };
  </code></pre>
  
  <p>I am trying to create an array which will have first element, last element, second element, second-last element and so on..</p>
  
  <p>So, my resulting output will be:-</p>
  
  <pre><code>int[] result = {10,40,20,30};
  </code></pre>
  
  <p>This was my approach, in one loop start from first and go till the middle &amp; in second loop start from last and get to the middle and select items accordingly, but I totally messed it up. Here is my attempted code:-</p>
  
  <pre><code>private static IEnumerable&lt;int&gt; OrderedArray(int[] numbers)
  {
      bool takeFirst = true;
      if (takeFirst)
      {
          takeFirst = false;
          for (int i = 0; i &lt; numbers.Length / 2; i++)
          {
              yield return numbers[i];
          }
      }
      else
      {
          takeFirst = true;
          for (int j = numbers.Length; j &lt; numbers.Length / 2; j--)
          {
              yield return numbers[j];
          }
      }
  }
  </code></pre>
  
  <p>Need Help.</p>