Listnumbers = new List { 1.5, 2.3, 3.7, 4.1 }; double total = numbers.Aggregate((acc, val) => acc + val);
ListThis code does the same thing as the previous example, but instead of adding values together, it checks each value against the accumulator variable (`acc`) to see if it is larger, and returns the largest value at the end. The `double Aggregate` method is part of the `System.Linq` namespace in C#, which is included in the `mscorlib` library.numbers = new List { 1.5, 2.3, 3.7, 4.1 }; double largest = numbers.Aggregate((acc, val) => acc > val ? acc : val);