Learn how to find whether given year is Leap year or not in asp.net using c#

In this tutorial of asp.net you will learn how to find whether given year is Leap year or not using c#. It's quite simple in asp.net by using the built-in IsLeapYear(Year) method of DateTime class that take one parameter which is a valid year. Let's have a look over example given below

Find whether given year is Leap year or not in asp.net using c#

Find-leap-year.aspx.cs
bool isLeapYear= DateTime.IsLeapYear(2007);

In the example given above, it will return True to the isLeapYear variable of Boolean type. I hope it will be great helpful for you.


Happy Coding, Keep Coding.

0 comments: