#include bool is_prime(int n) { if(n < 2) return false; for(int i = 2; n >= i*i; i++) if((n % i) == 0) return false; return true; } int main() { int x = 900; if(is_prime(x)) std::cout << x << " is prime.\n"; else std::cout << x << " is not prime.\n"; }