I'm writing a complex for loop to find prime numbers. What I have so far is this:
What I guess I'm trying to achieve is the rest of the loop...but I don't know howpublic static void algorithmOne(int n) {
boolean isPrime = true; //the number is a prime (has remainder)
for(int m = 2; m < n; m++) {
for (int c = 2; c < m; c++){
if(m%c == 0) isPrime = false; //is not a prime
}
I'm going to have to continue the loop somehow, end it, and print out the prime numbers.
Help please!