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