Tuesday, 9 June 2015

Program to find whether a year is a leap year or not


Code for Program to find whether a year is a leap year or not in C++ Programming



 



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


 main()
    {
       clrscr();

       int year;

       cout<<"\n Enter the year = ";
       cin>>year;

       if(year%4==0 || year%400==0 || year%100==0)
      cout<<"this is a leap year"<<endl;

       else
      cout<<"this is not a leap year"<<endl;

       getch();
       return 0;
    }

No comments:

Post a Comment