Returns an indication whether the year passed as method parameter is a leap year - CSharp System

CSharp examples for System:DateTime Year

Description

Returns an indication whether the year passed as method parameter is a leap year

Demo Code


using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   ww w . j av  a 2  s  .c om*/

public class Main{
        /// <summary>
        /// Returns an indication whether the year passed as method parameter is a leap year
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public static bool IsLeapYear(int year)
        {
            return DateTime.IsLeapYear(year);
        }
}

Related Tutorials