Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int num,i,check=0;
- scanf("%d",&num);
- if(num<=1) check = 1;
- else if(num==2) check = 0;
- else
- {
- for(i=2;i<=num/2;i++)
- {
- if(num%i==0) check=1;
- }
- }
- if(check == 1)
- {
- printf("Not Prime");
- }
- else
- {
- printf("Prime");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement