Sum with integers : Sum : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Sum »

 

Sum with integers








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

public class MainClass {
    public static void Main() {
        IEnumerable<int> ints = Enumerable.Range(1, 10);
        foreach (int i in ints)
            Console.WriteLine(i);
        int sum = ints.Sum();
        Console.WriteLine(sum);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Sum