Aggregate Prototype : Aggregate : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Aggregate »

 

Aggregate Prototype








    
 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass {
    public static void Main() {
        int N = 5;
        IEnumerable<int> intSequence = Enumerable.Range(1, N);
        foreach (int item in intSequence)
            Console.WriteLine(item);
        int agg = intSequence.Aggregate((av, e) => av * e);
        Console.WriteLine("{0}! = {1}", N, agg);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Aggregate