Skip to main content

C Program to check Leap Year

Programming Languages

Welcome to coding world

C Program to check Leap Year 

 This program checks whether the input year is leap year or not.

Example: Program to check Leap Year

You can check whether a year is leap or not by using this mathematical logic:

Leap Year:

If a year is divisible by 4, 100 and 400 then it is a leap year.
If a year is divisible by 4 but not divisible by 100 then it is a leap year

Not a Leap Year:

If a year is not divisible by 4 then it is not a leap year
If a year is divisible by 4 and 100 but not divisible by 400 then it is not a leap year

Let’s write this logic in a C Program. To understand this program you should have the knowledge of following C programming topic:

C Programming If..else, Nested if..else

#include <stdio.h>

int main()

{

    int y;

 

    printf("Enter year: ");

    scanf("%d",&y);

 

    if(y % 4 == 0)

    {

            //Nested if else

        if( y % 100 == 0)

        {

            if ( y % 400 == 0)

                printf("%d is a Leap Year", y);

            else

                printf("%d is not a Leap Year", y);

        }

        else

            printf("%d is a Leap Year", y );

    }

    else

        printf("%d is not a Leap Year", y);

 

    return 0;

}

Output:

Enter year: 1991

1991 is not a Leap Year

Popular posts from this blog

Bollywood actor Dharmendra has passed away at the age of 89

Legendary Bollywood actor Dharmendra has passed away at the age of 89.  R. I. P The 'He-Man' of Indian cinema, known for his iconic roles in films like 'Sholay', 'Seeta Aur Geeta', and 'Dharam Veer', breathed his last on November 24, 2025, in Mumbai. Dharmendra's career spanned over six decades, with more than 300 films to his credit. He was a recipient of the Filmfare Lifetime Achievement Award and the Padma Bhushan, among other accolades. His family, friends, and fans are mourning his loss, remembering him as a kind soul and an unforgettable icon of Indian cinema. 

Sales and Marketing jobs in UAE | Jobs in dubai 2026 | latest Gulf jobs 2026

   Mobile Number: 0553390204    WhatsApp Number: +971553390204                                                                          

Jannat ky pattay novel download pdf

Go to page bottom and click on download icon for downloading  full novel in pdf.  Jannat Ky Pattay JKP was written by a very well known writer Nimra Ahmed . There were many controversies related to this novel’s treasure hunt riddles. People have even stated that the content is not original but I won’t focus in these matters. As long  as the novel is gripping and teaches you a lot about Islam we could ignore these things. Suspense and detective touch has been added to this novel.              Click Here To Downlaod👇