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 191 views
1 answer 157 views
157 views asked Feb 11, 2016 by avibootz
1 answer 143 views
2 answers 57 views
1 answer 156 views
...