Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int primo (int n) {
- for(int i=2; i<n; i++) {
- if(n==2)
- return 1;
- if (n%i==0)
- continue;
- else
- return 1;
- }
- return 0;
- }
- main() {
- int n;
- printf("entre com um valor");
- scanf("%d",&n);
- printf("%d\n",primo(n));
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement