#include <iostream>
using namespace std;
class check
{
int a;
public:
void getdata();
void results();
};
void check::getdata()
{
cout<<"\nEnter the year is :";
cin>>a;
cout<<a;
}
void check::results()
{
if(a%4==0)
{
cout<<"\n"<<a<<"\nThe given year is leap year";
}
else
{
cout<<"\n"<<a<<"\nThe given year is not a leap year";
}
}
int main() {
check x;
cout <<"Leap year or not "<<endl;
x.getdata();
x. results();
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: