Created
September 23, 2012 15:01
-
-
Save passion8/3771918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * 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