How to find the average value in int array with C#

1 Answer

0 votes
using System;
using System.Linq;

class Program
{
    static void Main() {
        int[] arr = { 6, 8, 3, 9, 2, 4, 5 };
        
        double average_value = arr.Average();

        Console.Write(average_value);
    }
}



/*
run:

5.28571428571429

*/

 



answered Mar 8, 2021 by avibootz

Related questions

1 answer 295 views
1 answer 247 views
247 views asked Feb 11, 2016 by avibootz
1 answer 244 views
2 answers 189 views
1 answer 262 views
...