Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- int n, s=0,i;
- clrscr();
- cout<<"Enter the number"<<endl;
- cin>>n;
- for(i=2;i<n/2;i++)
- {
- if(n%i==0)
- s++;
- }
- if(s>=1)
- cout<<"The entered number is not prime"<<endl;
- else
- cout<<"The entered number is prime "<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment