- 1
java
how can i add first 50 prime numbers to array called primeNumbers?
3 RĂ©ponses
+ 5
Step 1
Write a function that tests a number for being prime.
Step 2
Loop through the numbers indefinitely, add to a list if it is prime using your method from step 1.
If you have 50 numbers, break the loop and return the list.
+ 3
I didi it! thanksđ
+ 2
You're welcome :)