title: How to increment the index of a list for saving the next number in next index of list
body: <p>I want to save the result of <code>zarb</code> function which repeats for 1000 times in a list with size 1000. Then I must to increase the index of the list for every calculation to avoid to save the next calculation at the same index of previous one. How can I do that?</p>
  
  <pre><code>var results = new List&lt;float&gt;(1000);
  for (int z = 0; z &lt; 1000; z++)
  {
     results.Add(zarb(sc,z));
     //increase the index of resukts
  }
  foreach (var resultwithindex in results.Select((r, index) =&gt; new { result = r, Index = index }).OrderByDescending(r =&gt; r.result).Take(20))
  {
     MessageBox.Show(string.Format("{0}: {1}", resultwithindex.Index, resultwithindex.result));
  }
  </code></pre>
  
  <p>Zarb function</p>
  
  <pre><code>public float zarb(int userid, int itemid)
          {
  
              float[] u_f = a[userid];
              float[] i_f = b[itemid];
  
              for (int i = 0; i &lt; u_f.Length; i++)
              {
  
                  result += u_f[i] * i_f[i];
  
              }
              return result;
  
          }
  </code></pre>