Would someone please give me this code? I need a program that finds all the prim
ID: 3616568 • Letter: W
Question
Would someone please give me this code? I need a program that finds all the prime numbers inbetweenone and a million by using this method. Is 2 prime? yes,therefore all multiles of 2 are not prime. Is 3 prime? Yes,therefore all multiples of 3 are not prime. 4 is a multiple of 2, so skip Is 5 prime? Yes,therefore all multiples of 5 are not prime. 6 is a multiple of 2 and 3, soskip Is 7 prime? Yes,therefore all multiples of 7 are not prime. 8 is a multiple of 2, so skip 9 is a multiple of 3, so skip Pretty much that's all I need, it is really frustrating andI'm bout to give up. If someone wants to give me the code I'dreally appreciate it. Thanks. Will rate lifesaver (Cause it will beone) Would someone please give me this code? I need a program that finds all the prime numbers inbetweenone and a million by using this method. Is 2 prime? yes,therefore all multiles of 2 are not prime. Is 3 prime? Yes,therefore all multiples of 3 are not prime. 4 is a multiple of 2, so skip Is 5 prime? Yes,therefore all multiples of 5 are not prime. 6 is a multiple of 2 and 3, soskip Is 7 prime? Yes,therefore all multiples of 7 are not prime. 8 is a multiple of 2, so skip 9 is a multiple of 3, so skip Pretty much that's all I need, it is really frustrating andI'm bout to give up. If someone wants to give me the code I'dreally appreciate it. Thanks. Will rate lifesaver (Cause it will beone) Pretty much that's all I need, it is really frustrating andI'm bout to give up. If someone wants to give me the code I'dreally appreciate it. Thanks. Will rate lifesaver (Cause it will beone)Explanation / Answer
please rate - thanks I assume you mean the Sieve ofEratosthenes import java.io.*; public class sieveofE {public static void main(String[] args) {int i,j,max=1000000; boolean sieve[]=new boolean[max]; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.