Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

isprime c++

bool isprime(int n)
{
    if(n<=1)
        return false;
    for (int i = 2; i <= sqrt(n); i++)
        if (n % i == 0)
            return false;
  
    return true;
}
 
PREVIOUS NEXT
Tagged: #isprime
ADD COMMENT
Topic
Name
9+1 =