Guest User

Untitled

a guest
Feb 15th, 2011
1,667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int primo (int n) {
  5.  
  6. for(int m=2; m<n; m++) {
  7.  
  8. if (n%m!=0)
  9. continue;
  10. else
  11. return 1;
  12. }
  13. return 0;
  14. }
  15.  
  16. main() {
  17.  
  18. int a;
  19. printf("entre com um valor");
  20. scanf("%d",&a);
  21. printf("%d\n",primo(a));
  22.  
  23. system("pause");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment