C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







How to Check Leap Year using C#


Posted Date: 28 May 2008    Resource Type: Articles    Category: .NET Framework

Posted By: Siva Prasad       Member Level: Gold
Rating:     Points: 10



Hello Friends,

Below was the article [ Method ] which will determine Leap Year using C#

private bool CheckLeapYear ( int year )
{
bool leapYear = false;
leapYear = ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) || ( ( year % 400 ) == 0 ) );
if ( leapYear.Equals ( true ) )
return true;
else
return false;
}

The above method returns true, if it is Leap Year.

Siva Prasad




Responses

Author: Mahesh Raj    07 Jun 2008Member Level: Gold   Points : 1
This is very good information,Continue posting such useful articles.


Author: John Fernandez    08 Jun 2008Member Level: Gold   Points : 1
Very well written Article.Thanks for sharing this information.


Author: Raju.M    08 Jun 2008Member Level: Gold   Points : 2
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;
}



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to display GridView Header Row Text
Previous Resource: Reading Excel into Access Database Using ADO.Net and C#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use