Monday, November 14, 2011

Leap Year or Not

Wap to check whether the year is leap year or not.


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int y;
cout<<"enter year";
cin>>y;
if(y%4==0)
cout<<"leap year";
else
cout<<"not a leap year";
getch();
}

**************
OUTPUT:
enter year 368
leap year
**************

No comments:

Post a Comment