Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Check if a year is leap year or not
//clang 3.8.0 #include <iostream> using namespace std; int main() { int year; cout << "Enter a year: "; cin >> year; if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) cout << year << " is a leap year."; else cout << year << " is not a leap year."; } else cout << year << " is a leap year."; } else cout << year << " is not a leap year."; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
AnnotateAttr templated test
set/map equal_range bug in libc++
constructor-is-not-called-in-this-aggregation-class
user defined exception
Assignment Operator Example
Print system time
Example of custom deleter to manage a resource.
wellformed number
Test titlu
Example
Please log in to post a comment.