Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int m, n;
- int main(void)
- {
- scanf("%d", &n);
- for(m = n - 1; m > 1, n % m != 0; m--)
- {
- if(m == 2)
- {
- printf("\n%d e primo\n", n);
- }
- }
- if(n % m == 0 && m > 2)
- {
- printf("\n%d nao e primo\n", n);
- }
- if(m == 1)
- {
- printf("2 e primo\n");
- }
- }
Add Comment
Please, Sign In to add comment