Do some leap year checks : Date Time : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Date Time »

 

Do some leap year checks








    
 

using System;
using System.Globalization;

class MainClass {
    public static void Main() {

        // 
        int[] years = { 1984, 2000, 1999, 2002 };
        for (int i = 0; i < years.Length; ++i) {
            if (DateTime.IsLeapYear(years[i]))
                Console.WriteLine("Year {0} is a leap year", years[i]);
            else
                Console.WriteLine("Year {0} is NOT a leap year", years[i]);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Date Time