C++ Program to Check Leap Year
//C++ Program to Check Leap Year
//header files
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int year;
cout << "Enter a year: ";
cin >> year;
if (year % 4 == 0)
{
if (year % 100 == 0)
{
if (year % 400 == 0)
cout << year << " is a leap year.";
else
cout << year << " is not a leap year.";
}
else
cout << year << " is a leap year.";
}
else
cout << year << " is not a leap year.";
getch();
}
Output
