Untitled
unknown
plain_text
5 months ago
340 B
3
Indexable
// Online C++ compiler to run C++ program online #include <iostream> using namespace std; int main() { int n, prime = 1; cin >> n; if (n <= 1) prime = 0; for (int i = 2; i < n && prime == 1; i++) if (n % i == 0) prime = 0; if (prime == 1) cout << "yes"; else cout << "no"; return 0; }
Editor is loading...
Leave a Comment