nikolas_serafini

Lista 2 - Exercício 6

May 24th, 2013
43
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. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int num,count=0;
  7.  
  8.     printf("Entre com o numero :\n"); scanf("%d",&num);
  9.  
  10.     if (num%2 == 0)
  11.     {
  12.         printf("O numero eh divisivel por 2!\n"); count++;
  13.     }
  14.     if (num%3 == 0)
  15.     {
  16.         printf("O numero eh divisivel por 3!\n"); count++;
  17.     }
  18.     if (num%5 == 0)
  19.     {
  20.         printf("O numero eh divisivel por 5!\n"); count++;
  21.     }
  22.     if (num%7 == 0)
  23.     {
  24.         printf("O numero eh divisivel por 7!\n"); count++;
  25.     }
  26.     else if(count == 0)
  27.     {
  28.         printf("O numero nao eh divisivel por nenhum dos numeros do sistema!\n");
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment