C# Extension Method: Int64 - IsEven

CSharp · Console

/Program.cs

// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002420/int64-iseven

// @nuget: Z.ExtensionMethods

using System;
					
public class Program
{
	public static void Main()
	{
        Int64 [] values = { 1, 7, 30, 365, 1000, 2500, 10000, 15000, 32767 };

        Console.WriteLine("{0,21}{1,18}","Value", "Is Even");
        Console.WriteLine("{0,21}{1,18}","-----", "-------");

        foreach (Int64 value in values)
        {
			// C# Extension Method: Int64 - IsEven
            Console.WriteLine("{0,21}{1,18}", value, value.IsEven() ? "True": "False");
        }
	}
}
;