nikolas_serafini

Lista 2 - Exercício 12

May 25th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int num;
  7.  
  8.     printf("Entre com o numero do mes :\n"); scanf("%d",&num);
  9.     if (num == 2)
  10.     {
  11.         printf("Mes com 28 dias!\n");
  12.     }
  13.     else if (num%2 != 0)
  14.     {
  15.         printf("Mes com 31 dias!\n");
  16.     }
  17.     else if (num%2 == 0)
  18.     {
  19.         printf("Mes com 30 dias!\n");
  20.     }
  21.     else printf("Mes invalido!\n");
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment