Last active
April 25, 2020 14:45
-
-
Save m-primo/2f8a351740f3cb1f6392782d0123c1f8 to your computer and use it in GitHub Desktop.
days in month - c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cin >> month_num; | |
switch (month_num) | |
{ | |
case 1:case 3:case 5:case 7:case 8:case 10:case 12: | |
daysinmonth = 31; | |
break; | |
case 2: | |
daysinmonth = 28; | |
break; | |
case 4: case 6: case 9: case 11: | |
daysinmonth = 30; | |
break; | |
default: | |
daysinmonth = -1; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment