Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, d=2, p=0;
- cout<<"n="; cin>>n;
- for(d; d<=n/2; d++)
- if(n%d==0)
- p++;
- if(p!=0)
- cout<<"Numarul nu este prim";
- else
- cout<<"Numarul este prim";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment