Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

isprime java

static boolean isPrime(int n){
	for (int i = 2; i <= Math.sqrt(n); i++)
		if (n % i == 0) return false;
	return n > 1;
}
 
PREVIOUS NEXT
Tagged: #isprime #java
ADD COMMENT
Topic
Name
8+9 =