Guest User

Untitled

a guest
Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int m, n;
  4.  
  5. int main(void)
  6. {
  7. scanf("%d", &n);
  8. for(m = n - 1; m > 1, n % m != 0; m--)
  9. {
  10. if(m == 2)
  11. {
  12. printf("\n%d e primo\n", n);
  13. }
  14. }
  15. if(n % m == 0 && m > 2)
  16. {
  17. printf("\n%d nao e primo\n", n);
  18. }
  19. if(m == 1)
  20. {
  21. printf("2 e primo\n");
  22. }
  23. }
Add Comment
Please, Sign In to add comment