//1 - true //0 - false //input is guaranteed to be positive //assume the containing module include math int isPrime(int inVal) { if(inVal < 4) { return true; }//if "easy" prime number int i; int stopVal = (int)(sqrt( (double)inVal )); for(i=2; i <= stopVal; i=i+1) { if !(inVal % i) { return 0; }//end "if inVal % i is zero" }//end for loop over inval return 1; }//isPrime