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