/* isPrime-v3.cpp tests n potential primes entered by user, using an EOF-controlled loop employs user-defined function, isPrime(), included from a header file */ #include #include "isPrime-fn2.h" using namespace std; void main(){ int n; //input integer //prompt cout << "enter n > 1 (c-d to exit): "; //driver loop while(cin >> n){ //display result cout << n << " is " << (isPrime(n) ? "prime" : "composite") << endl; //prompt cout << endl << "enter n > 1 (c-d to exit): "; } cout << endl << "Exiting..." << endl; }