title: Finding average for an array of elements one at a time
body: <p>I have an array of numbers which are prices of a stock as given below:</p>
  
  <pre><code>double[] xyz=new double{ 10.1, 20.34, 35.46, 78.34, 98.67, 43.73 ........} 
  </code></pre>
  
  <p>Now, I want to find the average of stock based on time:</p>
  
  <blockquote>
    <p>1st min  =  Average(10.1)  = 10.1</p>
    
    <p>2nd min  =  Average(10.1 + 20.34) =  15.22</p>
    
    <p>3rd min  =  Average(10.1 + 20.34 + 35.46) = 21.96</p>
  </blockquote>
  
  <p>One way of doing this is to loop minutes times(1,2,3,4...) and find the average. But, as my list is very huge, this can become a performance issue.</p>
  
  <p>Is there any other way of finding average each time?</p>
  
  <p>Thanks a lot.</p>
  
  <p>Mahesh</p>