nikolas_serafini

Lista 5 - Exercício 18

Jul 6th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6.   char monthName[12][15] = {"Janeiro","Fevereiro","Marco","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"};
  7.   int month;
  8.   int monthGrid[12][2] = {
  9.     {1, 31},
  10.     {2, 29},
  11.     {3, 31},
  12.     {4, 30},
  13.     {5, 31},
  14.     {6, 30},
  15.     {7, 31},
  16.     {8, 31},
  17.     {9, 30},
  18.     {10, 31},
  19.     {11, 30},
  20.     {12, 31}};
  21.  
  22.   printf("Entre com o numero do mes desejado :\n");
  23.   scanf("%d",&month);
  24.   printf("Mes : %s\nNumero de dias : %d",monthName[month-1],monthGrid[month-1][1]);
  25.  
  26.   return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment