Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# Program to check if a given year is leap year

// C# program to check
// for a leap year
using System;
 
class GFG
{
     
    static bool checkYear(int year)
    {
        // If a year is multiple of 400,
        // then it is a leap year
        if (year % 400 == 0)
            return true;
     
        // Else If a year is multiple of 100,
        // then it is not a leap year
        if (year % 100 == 0)
            return false;
     
        // Else If a year is multiple of 4,
        // then it is a leap year
        if (year % 4 == 0)
            return true;
        return false;
    }
         
    // Driver method
    public static void Main()
    {
        int year = 2000;
        Console.Write( checkYear(year)? "Leap Year" :
                                 "Not a Leap Year" );
    }
 
}
 
// This code is contributed by Sam007
Comment

c# leap year check

(DateTime.IsLeapYear(jaartal))
Comment

PREVIOUS NEXT
Code Example
Csharp :: element click intercepted exception in selenium C# 
Csharp :: rigidbody.addforce not working 
Csharp :: check file lock c# 
Csharp :: c# remove substring 
Csharp :: get device name c# console 
Csharp :: deploy .net core 
Csharp :: c# convert double to string 
Csharp :: C# domain name to ip address 
Csharp :: compare two strings in c# 
Csharp :: mysql: [Warning] Using a password on the command line interface can be insecure. 
Csharp :: sum the digits in c# 
Csharp :: convert c# string to int 
Csharp :: how to add data in list in c# 
Csharp :: visitor pattern 
Csharp :: unity unit tests 
Csharp :: C# random.Next error 
Csharp :: dxf read c# 
Csharp :: take photo function in unity 
Csharp :: c# linq select specific columns 
Csharp :: check if two date ranges overlap c# 
Csharp :: C# Linq item index 
Csharp :: c# Intersectcase insensitive 
Csharp :: clickable table row asp.net core 
Csharp :: how set format persian data picker to en 
Csharp :: top down view movement script 
Csharp :: c# int to string date conversion 
Csharp :: how to add gravity without rb in unity 
Csharp :: remove empty strings from list c# 
Csharp :: unity sprite disappears when using transform.lookat 
Csharp :: Get logged in user in ASP.Net 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =