Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- enum MONTH { JAN=1, FEB, MARCH, APRIL, MAY, JUNE, JULY, AUG, SEPT, OCT, NOV, DEC };
- int main()
- {
- int num;
- cout << "enter a number:" << endl;
- cin >> num;
- if (num > 0 && num < 13) { //number between 1-12
- switch (num) {
- case JAN:
- cout << "31 days in the month" << endl;
- break;
- case FEB:
- cout << "28 days in the month" << endl;
- break;
- case MARCH:
- cout << "31 days in the month" << endl;
- break;
- case APRIL:
- cout << "30 days in the month" << endl;
- break;
- case MAY:
- cout << "31 days in the month" << endl;
- break;
- case JUNE:
- cout << "30 days in the month" << endl;
- break;
- case JULY:
- cout << "31 days in the month" << endl;
- break;
- case AUG:
- cout << "31 days in the month" << endl;
- break;
- case SEPT:
- cout << "30 days in the month" << endl;
- break;
- case OCT:
- cout << "31 days in the month" << endl;
- break;
- case NOV:
- cout << "30 days in the month" << endl;
- break;
- case DEC:
- cout << "31 days in the month" << endl;
- break;
- }
- }
- // system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement