CSharp examples for LINQ:Aggregate
Adding up the numbers array
using System;// ww w . j a v a2s. c om using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { int[] numbers = new[] { 5, 7, 1, 4, 9, 3, 0, 2, 6, 8 }; var sum = numbers.Sum(); Console.WriteLine("\tSum of the numbers is {0}", sum); } }