Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. enum MONTH { JAN=1, FEB, MARCH, APRIL, MAY, JUNE, JULY, AUG, SEPT, OCT, NOV, DEC };
  4. int main()
  5. {
  6. int num;
  7. cout << "enter a number:" << endl;
  8. cin >> num;
  9. if (num > 0 && num < 13) { //number between 1-12
  10.  
  11. switch (num) {
  12. case JAN:
  13. cout << "31 days in the month" << endl;
  14. break;
  15. case FEB:
  16. cout << "28 days in the month" << endl;
  17. break;
  18. case MARCH:
  19. cout << "31 days in the month" << endl;
  20. break;
  21. case APRIL:
  22. cout << "30 days in the month" << endl;
  23. break;
  24. case MAY:
  25. cout << "31 days in the month" << endl;
  26. break;
  27. case JUNE:
  28. cout << "30 days in the month" << endl;
  29. break;
  30. case JULY:
  31. cout << "31 days in the month" << endl;
  32. break;
  33. case AUG:
  34. cout << "31 days in the month" << endl;
  35. break;
  36. case SEPT:
  37. cout << "30 days in the month" << endl;
  38. break;
  39. case OCT:
  40. cout << "31 days in the month" << endl;
  41. break;
  42. case NOV:
  43. cout << "30 days in the month" << endl;
  44. break;
  45. case DEC:
  46. cout << "31 days in the month" << endl;
  47. break;
  48.  
  49. }
  50. }
  51.  
  52. // system("pause");
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement