LINQ with IENUMERABLE in C#

IEnumerable is generally used with LINQ. It specifies that the underlying type implements the GetEnumerator method. It enables the foreach-loop to be used.

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

namespace ForgetCode
{   
    public class MainClass
    {
        public static void Main()
        {
            IEnumerable<int> result = from value in Enumerable.Range(0, 2)
                                      select value;
           
            foreach (int value in result)
            {
                Console.WriteLine(value);
            }
            
        }
    }
}


Output:
0
1