Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* C0r3
- Claus Ruepp */
- #include <stdio.h>
- #include <stdlib.h>
- main(){
- int month;
- printf("Enter the number of your month (1-12):\t");
- scanf("%d", &month);
- while (1>month>12){
- printf("Your number is not between 1 and 12. Try again.\t");
- scanf("%d", &month);
- }
- switch (month) {
- case 1:
- printf("Your month is January.");
- break;
- case 2:
- printf("Your month is February.");
- break;
- case 3:
- printf("Your month is March.");
- break;
- case 4:
- printf("Your month is April.");
- break;
- case 5:
- printf("Your month is May.");
- break;
- case 6:
- printf("Your month is June.");
- break;
- case 7:
- printf("Your month is July.");
- break;
- case 8:
- printf("Your month is August.");
- break;
- case 9:
- printf("Your month is September.");
- break;
- case 10:
- printf("Your month is October.");
- break;
- case 11:
- printf("Your month is November.");
- break;
- case 12:
- printf("Your month is December.");
- break;
- default:
- printf("Your number is not between 1 and 12.");
- }
- }
Add Comment
Please, Sign In to add comment