Guest User

Untitled

a guest
Jan 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.11 KB | None | 0 0
  1. /*          C0r3
  2.         Claus  Ruepp        */
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. main(){
  7.  int month;
  8.  printf("Enter the number of your month (1-12):\t");
  9.  scanf("%d", &month);
  10.  while (1>month>12){
  11.   printf("Your number is not between 1 and 12. Try again.\t");
  12.   scanf("%d", &month);
  13.   }
  14.  switch (month) {
  15.    case 1:
  16.     printf("Your month is January.");
  17.     break;
  18.    case 2:
  19.     printf("Your month is February.");
  20.     break;
  21.    case 3:
  22.     printf("Your month is March.");
  23.     break;
  24.    case 4:
  25.     printf("Your month is April.");
  26.     break;
  27.    case 5:
  28.     printf("Your month is May.");
  29.     break;  
  30.    case 6:
  31.     printf("Your month is June.");
  32.     break;  
  33.    case 7:
  34.     printf("Your month is July.");
  35.     break;
  36.    case 8:
  37.     printf("Your month is August.");
  38.     break;
  39.    case 9:
  40.     printf("Your month is September.");
  41.     break;
  42.    case 10:
  43.     printf("Your month is October.");
  44.     break;
  45.    case 11:
  46.     printf("Your month is November.");
  47.     break;
  48.    case 12:
  49.     printf("Your month is December.");
  50.     break;
  51.    default:
  52.     printf("Your number is not between 1 and 12.");
  53.  }
  54. }
Add Comment
Please, Sign In to add comment