We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46803a6 commit e5ca425Copy full SHA for e5ca425
asdffsdafs.cpp
@@ -0,0 +1,30 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
6
+ int year;
7
+ cout << "Enter a year: ";
8
+ cin >> year;
9
10
+ // leap year if perfectly divisible by 400
11
+ if (year % 400 == 0) {
12
+ cout << year << " is a leap year.";
13
+ }
14
+ // not a leap year if divisible by 100
15
+ // but not divisible by 400
16
+ else if (year % 100 == 0) {
17
+ cout << year << " is not a leap year.";
18
19
+ // leap year if not divisible by 100
20
+ // but divisible by 4
21
+ else if (year % 4 == 0) {
22
23
24
+ // all other years are not leap years
25
+ else {
26
27
28
29
+ return 0;
30
+}
0 commit comments