Advertisement
Guest User

Untitled

a guest
May 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4.  
  5. {
  6.  
  7. int num,i;
  8. scanf("%d",&num);
  9.  
  10. for(i=2;i<num;i++){
  11.  
  12. if(num%i==0){
  13. printf("Not prime.\n");
  14. break;
  15. }
  16. }
  17. if(num==i){
  18. if(num%2==0){
  19. printf("Prime and even.\n");
  20. }
  21. else printf("Prime and odd.\n");
  22.  
  23. }
  24.  
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement