c# - How to get the average of an int array elements

Int array average

The following asp.net c# example code demonstrate us how can we get average from an int array elements value
programmatically in an asp.net application. Int array represent an array of elements whose all values are integer (Int32).

Int array only hold integer data type values, so we can apply number only methods of int array elements/items value.
Linq Average() method computes the average of a sequence of numeric values. So we can get average of an int array values.

We can call the Average() method as this way IntArray.Average(). This method has no required o optional parameter to pass,
we just need to call the method after specifying a numeric values sequence.