The following method returns "true" if the given year is a leap year and "false" if not.
System.DateTime.IsLeapYear(here give year)
Hope this helps!
Added custom written logic:
private bool IsLeapYear(int yearNumber)
{
if ((yearNumber % 400) == 0)
return true;
else if ((yearNumber % 100) == 0)
return false;
else if ((yearNumber % 4) == 0)
return true;
else
return false;
}
But you really should use the build in logic of the .Net Framework!!