Linq Example 40 - Average

11:25 PM
Linq Query:

//Average

            int[] myNumbers = { 5, 8, 6, 2, 1, 9, 4, 6 };

            double avg = myNumbers.Average();

            Console.WriteLine(avg);

//

Output:
5.125

0 comments:

Post a Comment