Social Icons

Saturday, 15 February 2014

Program to Check whether a year is Leap year or not

#include<iostream.h>
#include<conio.h>

void main()
{
int year;
clrscr();     //to clear the screen

cout<<"\n Enter any year(4-digit) : ";
cin>>year;

if((year%400==0)||(year%100!=0) && (year%4==0))
     cout<<"\n Year "<<year<<" is Leep Year";
else
      cout<<"\n Year "<<year<<" is Not a Leep Year";

getch();     //to stop the screen
}


                                                    Output

No comments:

Post a Comment