[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:Before worrying about 2 and 3 being missing, you should work on the algorithm. 25 is not a prime number. Nor is 35, 49, etc. All you've done is omit the numbers divisible by 2 and 3.
Once you have a proper algorithm for finding prime numbers, I bet the "2 and 3 are special" problem goes away. Remember - the definition of a prime # is that it is only divisible by itself and 1. (and is not 1)
Jeanne Boyarsky wrote:Before worrying about 2 and 3 being missing, you should work on the algorithm. 25 is not a prime number. Nor is 35, 49, etc. All you've done is omit the numbers divisible by 2 and 3.
Once you have a proper algorithm for finding prime numbers, I bet the "2 and 3 are special" problem goes away. Remember - the definition of a prime # is that it is only divisible by itself and 1. (and is not 1)
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:I'm not sure what that does. What does it output?
var array = new Array(100);