-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC ++ Enumeration month.cpp
More file actions
42 lines (35 loc) · 1.31 KB
/
C ++ Enumeration month.cpp
File metadata and controls
42 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
[AUTHOR]: Saddam Arbaa
[Email] : <saddamarbaas@gmail.com>
Enumeration Example Exercises in C++
write c++ program to declare EDT and display
the different between month
*/
#include <iostream>
using namespace std;
// define enum
enum month{ January = 31,
February = 28,
March = 31,
April = 30,
May = 31 ,
June = 30 ,
July = 31,
August = 31,
September = 30,
October = 31,
November = 30,
December = 31
};
// the Driver Code
int main()
{
// display the different between month
cout << "the different between January and February is = " << January - February<< " days"<< endl;
cout << "the different between March and April is = " << March - April << " day"<< endl;
cout << "the different between May and June is = " << May - June << endl;
cout << "the different between July and August is = " << July - August << endl;
cout << "the different between September and October is = " << September - October << endl;
cout << "the different between November and December is = " << November - August << endl;
return 0;// signal to operating system everything works fine
}/** End of main function */