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