Advertisement
son4etyyy

LeapYear

Jan 26th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _1.LeapYear
  8. {
  9.     /*Write a program that reads a year from the console and checks whether it is a leap. Use DateTime.*/
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             ushort year = ushort.Parse(Console.ReadLine());
  15.             bool isleap = DateTime.IsLeapYear(year);
  16.             Console.WriteLine("Is {0} leap year?  {1}", year, isleap);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement