All you did was present us with your (likely homework) problem. You didn't tell us how you've already tried to solve the problem or provide us with any code you've started with (besides the function skeletons [that it looks like your teacher gave to you]). You havn't been specific enough either. Like what should the program do if there are no primes at all in the array? Throw an exception, bail, prompt the user, look in another array?
private boolean isPrime(int num) {
int i = 2;
while(i < num) {
int j = num % i;
if(j == 0)
return false;
else
i++;
}
return true;
} I'm providing you with one of the functions I've written that you'll obviously need. I left it uncommmented on purpose. If you can't figure out the rest of what you need to make those functions work, I suggest you take a different class.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)
<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?