MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main

Function main

Lab_02/06_leap_year.cpp:6–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace std;
5
6int main()
7{
8 int year;
9 cout << "Enter a Year: ";
10 cin >> year;
11
12 if (year % 4 == 0)
13 {
14 if (year % 100 == 0)
15 {
16 if (year % 400 == 0)
17 {
18 cout << "Given " << year << " year is a leap." << endl;
19 }
20 else
21 {
22 cout << "Given " << year << " year isn't a leap." << endl;
23 }
24 }
25 else
26 {
27 cout << "Given " << year << " year is a leap year." << endl;
28 }
29 }
30 else
31 {
32 cout << "Given " << year << " year isn't a leap." << endl;
33 }
34 system("pause");
35 return 0;
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected