Number detective seeks elusive primes

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Can you fill the blanks in the code to check if a number is prime? The program should print "Prime" if the number is prime, and "Not Prime" otherwise.
Fill in the gaps with the relevant elements
int n = 17;
boolean isPrime = true;
 (int i = 2; i <= Math.sqrt(n); i++) {
    if (n % i == 0) {
        isPrime = false;
        ;
    }
}
System.out.println(isPrime ? "Prime" : "Not Prime");
forwhilecontinuebreak

Create a free account to access the full topic