Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /*hello Patadia
  2. chek this code*/
  3. #include<iostream.h>
  4. #include<conio.h>
  5. void main()
  6. {
  7. //clrscr();
  8. int number,count=0;
  9. cout<<"ENTER NUMBER TO CHECK IT IS PRIME OR NOT ";
  10. cin>>number;
  11. for(int a=1;a<=number;a++)
  12. {
  13. if(number%a==0)
  14. {
  15. count++;
  16. }
  17. }
  18. if(count==2)
  19. {
  20. cout<<" PRIME NUMBER \n";
  21. }
  22. else
  23. {
  24. cout<<" NOT A PRIME NUMBER \n";
  25. }
  26. //getch();
  27. }
  28. //Thanks Kiru
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement