Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define ll long long
- void Isprime(ll x){
- int e=0;
- if (x%2==0){
- cout<<"Is not Prime";
- }
- else {
- for (int i=3; i*i<=x; i++){
- if (x%i==0) e=1;
- }
- if (e==0) cout<<"Is Prime";
- else {
- cout<<"Is not Prime";
- }
- }
- }
- int main()
- {
- ll n;
- cin>>n;
- Isprime(n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement