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();
}

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

Leave a Reply

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