#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Enter the year ";
cin>>a;
if (a%400==0)
{ cout<<"This year is not a leap year "; /*Century years divisible by 400 are not leap year*/
}
else
{ if (a%4==0)
{cout<<"This year is leap year ";
}
else
{cout<<"This year is not a leap year ";
}
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Enter the year ";
cin>>a;
if (a%400==0)
{ cout<<"This year is not a leap year "; /*Century years divisible by 400 are not leap year*/
}
else
{ if (a%4==0)
{cout<<"This year is leap year ";
}
else
{cout<<"This year is not a leap year ";
}
}
getch();
}
No comments:
Post a Comment