using System; using System.Linq; namespace ClassExamples { class LinqDemo2 { public static void Main() { int[] array = {0,1,2}; // select the even elements of the array var result = from x in array where x % 2 == 0 select x; array[0] = 3; foreach (int x in result) { Console.WriteLine(x); } } } }