using System;
public class Program
{
public static void Main()
// Initializing the List
double[] arr = {5.2, 6.4, -2.3, 12, 15.42};
// First calculate the sum
double sum = 0;
int counter = 0;
while (counter < arr.Length)
// Add the new number to the previous total
sum = sum + arr[counter];
/* Debug statements
Console.WriteLine("counter = " + counter);
Console.WriteLine("arr[counter] = " + arr[counter]);
Console.WriteLine("sum = " + sum);
Console.WriteLine();
*/
counter++;
}
double average = sum / arr.Length;
Console.WriteLine("The average is " + average);