.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Linq;
					
public class Program
{
	public static void Main()
	{
		IOrderedEnumerable<int> o = new[] { 1, 2, 3, 2, 1 }.OrderBy(i => i % 2);
		// prints 2, 2, 1, 3, 1
		Console.WriteLine(string.Join(", ", o));
	}
}
;