- 1

java

how can i add first 50 prime numbers to array called primeNumbers?

28th Apr 2022, 8:36 AM
burçin özkan
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.
28th Apr 2022, 8:39 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 3
I didi it! thanks🙂
28th Apr 2022, 9:13 AM
burçin özkan
+ 2
You're welcome :)
28th Apr 2022, 10:10 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar