Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*hello Patadia
- chek this code*/
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- //clrscr();
- int number,count=0;
- cout<<"ENTER NUMBER TO CHECK IT IS PRIME OR NOT ";
- cin>>number;
- for(int a=1;a<=number;a++)
- {
- if(number%a==0)
- {
- count++;
- }
- }
- if(count==2)
- {
- cout<<" PRIME NUMBER \n";
- }
- else
- {
- cout<<" NOT A PRIME NUMBER \n";
- }
- //getch();
- }
- //Thanks Kiru
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement