C++ : check whether a year is leap or not


#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int year;
cout<<"Year = ";
cin>>year;
if(year%4==0)
cout<<year<<" is a leap year.";
else
cout<<year<<" is not a leap year.";
getch();
return(0);
}

No comments:

Post a Comment