C++ Program to Check whether a year is Leap year or not

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int year;
cout<<“Enter Year(ex:1900):”;
cin>>year;
if(year%100==0)
{
if(year%400==0)
cout<<“nLeap Year”;
}
else
if(year%4==0)
cout<<“nLeap Year”;
else
cout<<“nNot a Leap Year”;
getch();
}

3 thoughts on “C++ Program to Check whether a year is Leap year or not

  1. varghese

    #include
    main()
    {
    int a;
    printf(“Enter a year”);
    scanf(“%d”,&a);
    if(a%4==0)
    printf(“Year is a leap year”);
    else
    printf(“Year is not a leap year”);
    }

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *