aleahim

CheckLeapYear

Jan 31st, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. class CheckLeapYear
  4. {
  5.     static void Main()
  6.     {
  7.         int nYear = int.Parse(Console.ReadLine());
  8.         bool bResult = DateTime.IsLeapYear(nYear);
  9.  
  10.         if (bResult.Equals(true))
  11.         {
  12.             Console.WriteLine("{0} is a Leap year",nYear);
  13.         }
  14.  
  15.         else
  16.         {
  17.             Console.WriteLine("{0} is NOT a Leap year", nYear);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment