C doesn't know what a prime number is, but because of the testing done in this part of the code, your program now can tell:
Code:
/* has any factors, from 3 to last */
/* Loop through odd numbers only */
for ( i = 3; (i <= last) && isPrime; i += 2 ) {
if ( (candidate % i) == 0 )
isPrime = false;
}
At the end of that loop, every odd number from 3 to last, has been divided into your candidate number. If nothing divides evenly into it, then it's prime. By that test alone, the program "knows" what a prime number is.