Write code to list the first 20 prime numbers
Anonymous
primeCounter = 0. Create for loop for(i = 2; primeCounter < 20; i++), then test in for loop if "i" is prime. if "i" is prime then print the value of i, and primeCounter++. This will give print the first 20 prime numbers in the array once the function completes. You can create a simple isPrime(int value) function from some of my other answers listed on here.
Check out your Company Bowl for anonymous work chats.