Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int n,i,m,p,flag=0;
- clrscr();
- printf("Enter the number:");
- scanf("%d",&n);
- i=2;
- do
- {
- if(n%i==0)
- flag=1;
- i++;
- }
- while(i<n/2);
- if(flag==1)
- printf("%d is not prime\n",n);
- else
- printf("%d is prime\n",n);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment