Thursday, October 28, 2010

Leap Year

#include

#include

class leap

{

int year;

public:

void lp();

};

void leap::lp()

{

cout<<"Enter Year";

cin>>year;

if(year%400==0||(year%100!=0&&year%4==0))

{

cout<<"Leap Year";

}

else

cout<<"Not leap Year";

}

void main()

{

leap a;

a.lp();

getch();

}

OUTPUT

Enter Year 2004

Leap Year

No comments:

Post a Comment