int[] nums = new int[] {0,4,2,6,3,8,5,1}; var result = from n in nums where n < 5 orderby n select n; foreach(var i in result) Console.WriteLine(i); /* Output:01234*/