title: Store for loop value in array
body: <p>I want to write a function which return an array which contain a for loop that enumerates some value I want to store them in to an array. I tried this</p>
  
  <pre><code>public int[] a()
  {
     int[] b=new int []{};
  
     for(int i=0;i&lt;10;i++) 
     {
         b[i]=i   {Index out of range exception comes}
     } 
  
     return b;
  } 
  </code></pre>
  
  <p>I don't like to use <code>enumerable.range()</code> because of performance issue.
  I want to keep the array size empty. </p>