Skip to content

Instantly share code, notes, and snippets.

@passion8
Created September 23, 2012 15:01
Show Gist options
  • Save passion8/3771918 to your computer and use it in GitHub Desktop.
Save passion8/3771918 to your computer and use it in GitHub Desktop.
* Leap year concept : year is divided by 4 but not divided by 100.If is divided by both,then it must divided by 400 .
#include <iostream>
using namespace std;
int main(){
int year;
cin>>year;
if( (year % 4 == 0 && year % 100 != 0) || (year%100 == 0 && year % 400 == 0) ){
cout << year<<" is a leap year";
}else
cout <<year<<" not a year year"<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment