System Average is a method provided by the C# programming language to calculate the average of a set of numbers. It is part of the System namespace and is a member of the Math class.
Code examples:
Example 1: double[] numbers = { 2.5, 3.5, 4.5 }; double average = System.Math.Average(numbers); Console.WriteLine("The average of the numbers is: {0}", average);
Example 2: int[] grades = { 85, 90, 92, 80 }; double average = System.Math.Average(grades); Console.WriteLine("The average grade is: {0}", average);
In Example 1, we have an array of double numbers, and we use the Average method to calculate their average. In Example 2, we have an array of integer grades, and we again use the Average method to calculate their average.
The System Average method is part of the System.Linq namespace, which is a package library within the .NET framework. This namespace provides a set of language extensions for querying data against .NET collections.
C# (CSharp) System.Average - 21 examples found. These are the top rated real world C# (CSharp) examples of System.Average extracted from open source projects. You can rate examples to help us improve the quality of examples.