Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int funkcijazaprost(int n){
  4. if(n==1){
  5. // printf("Brojot ne e ni prost ni slozen");
  6. return -1;
  7. }
  8. if(n==2){
  9. // printf("Brojot ne e ni prost ni slozen");
  10. return 1;
  11. }
  12.  
  13. int i;
  14. for(i=2;i<n;i++){
  15. if(n%i==0)
  16. return 0;
  17. }
  18. return 1;
  19.  
  20. }
  21.  
  22. int main()
  23. {
  24. int n;
  25. int i;
  26. scanf("%d",&n);
  27. if(funkcijazaprost(n)==1){
  28. printf("Prost e ");
  29. }
  30. if(funkcijazaprost(n)==-1){
  31. printf("Brojot ne e ni prost ni slozen");
  32. }
  33. else{
  34. printf("Ne e prost");
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement