Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ write the program with the functions stated .... The Sieve of Eratosthenes and Goldbach's Conjecture Implement the Sieve of Eratosthenes and use it
in c++ write the program with the functions stated ....
The Sieve of Eratosthenes and Goldbach's Conjecture Implement the Sieve of Eratosthenes and use it to find all prime numbers less than or equal to one million. Use the result to prove Goldbach's Conjecture for all even integers between four and one million, inclusive. Implement a function with the following declaration. void sieve (int array[], int nun); This function takes an integer array as its argument. The array should be initialized to the values 1 through 1000000. The function modifies the array so that only the prime numbers remain; all other values are zeroed out. This function must be written to accept an integer array of any size. You must should output for all primes numbers between 1 and 1000000, but when I test your function it may be on an array of a different size. Implement a function with the following declaration: void goldbach (int array[], int num); This function takes the same argument as die previous function and displays each even integer between 4 and 1000000 with two prime numbers that add to it. The goal here is to provide an efficient implementation. This means no multiplication, division, or modulus when determining if a number is prime. It also means that the second function must find two primes efficiently. Output for your program: All prime numbers between 1 and 1000000 and all even numbers between 4 and 1000000 and the two prime numbers that sum up to itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started