Fresh Information, Great Ideas, Latest Product Review & Specification » Computer & Gadget

Fresh Information, Great Ideas, Latest Product Review & Specification » Home and Appliances

Fresh Information, Great Ideas, Latest Product Review & Specification » Camera & Photography

Sunday, July 4, 2010

C# PROGRAM DETERMINE LEAP YEAR


using System;

namespace leapyear
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Enter a year");
string a = Console.ReadLine();
// int a = int.Parse(a);
if (a.Length==4)
{
int b = int.Parse(a);
if((b%4)==0)
{
Console.WriteLine("Leap Year");
}
else
{
Console.WriteLine("Not a Leapyear");
}
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}

No comments:

Post a Comment