/* isPrime-fn1.h * recognizer (predicate function) for prime numbers */ #include using namespace std; /* isPrime()--------------------------------------- * returns true if n is prime; otherwise returns false */ bool isPrime(long n){ int pd = 2; //potential divisor //generate and test divisors while(n % pd != 0) pd++; //return result return (n == pd); }