Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /* 11. Verifique se um número é primo ou não. */
- int main()
- {
- int numero,i,verificador=0;
- printf("\n Digite um numero: ");
- scanf("%d",&numero);
- for(i=1;i<=numero;i++)
- {
- if(numero % i == 0)
- {
- verificador ++;
- }
- }
- if(verificador > 2)
- {
- printf("\n Naum eh primo!!");
- }else{
- printf("\n Eh primo!!");
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement