title: Finding the Arithmetic Mean of an Array: C#
body: <p>Language: C#</p>
  
  <p>I have an array of numbers that the user entered, and I want to find the arithmetic mean of the array.</p>
  
  <p>I looked up a couple of similiar cases, but couldn't really find anything I was looking for... Anyway, here is the code:</p>
  
  <pre><code>            Console.WriteLine("\n How many numbers do you want to average? \n");
  
              int nNumtoAvg = Convert.ToInt32(Console.ReadLine());
  
  
              int[] nListToAverage = new int[nNumtoAvg];
  
  
  
              for (int i = 0; i &lt; nNumtoAvg; i++)
              {
  
                  Console.WriteLine("Enter whole number #" + (i + 1) + ": ");
  
                  string sVal = Console.ReadLine();
  
                  int nValue = Convert.ToInt32(sVal);
  
                  nListToAverage[i] = nValue;
  
              }
  </code></pre>
  
  <p>Now, what would I do to add all the numbers in the array together, and then divide that by the array.Length? Thanks in advance :D</p>