Int32 - IsLeapYear

Returns an indication whether the specified year is a leap year.

Try it

public static void Main()
{
    Console.WriteLine("Leap years between 1990 and 2020.\n\n");
    for (int year = 1990; year <= 2020; year++)
    {
		// C# Extension Method: Int32 - IsLeapYear
        if (DateTime.IsLeapYear(year))
        {
            Console.WriteLine(year);
        }
    }
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     Returns an indication whether the specified year is a leap year.
    /// </summary>
    /// <param name="year">A 4-digit year.</param>
    /// <returns>true if  is a leap year; otherwise, false.</returns>
    public static Boolean IsLeapYear(this Int32 year)
    {
        return DateTime.IsLeapYear(year);
    }
}