Leap year program



Leap year is a year, occurring once every four years, which has 366 days including 29 February as an intercalary day. 

 

Flowchart  

 

 

 

 

Program  


#include <stdio.h>
#include <conio.h>
void main()
{
    int a;
    printf("enter a year: ");
    scanf("%d", &a);
    if (a % 4 == 0)
    {
        if (a % 100 == 0)
        {
            if (a % 400 == 0)
            {
                printf("%d is leap year!"a);
            }
            else
            {
                printf("%d is not a leap year!"a);
            }
        }
        else
        {
            printf("%d is a leap year!"a);
        }
    }
    else
    {
        printf("%d is not a leap year!"a);
    }
    getch();
}


output

enter a year: 2000

2000 is a leap year!


Follow our page for regular updates.

0 Comments