nikolas_serafini

Lista 2 - Exercício 29

May 26th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.        
  7.     int day,month;
  8.  
  9.     printf("Entre com a sua data de nascimento : (formato dd/mm)\n");
  10.     scanf("%d %d",&day,&month);
  11.  
  12.     if ((month<3)&&(month>=1))
  13.     {
  14.         printf("Voce nasceu no primeiro semestre!\n");
  15.     }
  16.     else if ((month<6)&&(month>=1))
  17.     {
  18.         printf("Voce nasceu no segundo semestre!\n");
  19.     }
  20.     else if ((month<9)&&(month>=1))
  21.     {
  22.         printf("Voce nasceu no terceiro semestre!\n");
  23.     }
  24.     else if ((month<=12)&&(month>=1))
  25.     {
  26.         printf("Voce nasceu no quarto semestre!\n");
  27.     }
  28.     else printf("DATA INVALIDA!\n");
  29.    
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment