Advertisement
Shohag_Rana_Hriday

prime number

Feb 5th, 2020
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7.  
  8. int n1,n2,i,j;
  9. cin>>n1;
  10. cin>>n2;
  11.  
  12. for(i=n1;i<=n2;i++)
  13. {
  14. for(j=2;j<n1;j++)
  15. {
  16. if(i%j==0)
  17. {
  18. cout<<i<<"prime number\n";
  19. }
  20. else {
  21. cout<< i<<"not prime number";
  22. }
  23.  
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement