C++ program using threads to find number of prime numbers Write a program to fin
ID: 3912902 • Letter: C
Question
C++ program using threads to find number of prime numbers
Write a program to find, and provide a count of prime numbers between 1 and a user provided limit or maximum value. For example, between 1 and 10,000 there are exactly 1229 prime numbers. In order to improve performance, the program should use threads to perform computations in parallel. Additionally, the program should use the C++11 high resolution clock to provide an execution time in milliseconds The program should read the thread count and limit from the command line in the following format: The way to determine if a number is prime is as follows: The numbers 2 and 3 are prime For a given number, i> 3: If i is divisible by 2, then i is not prime If is not divisible by 2, then: Calculate k- the approximate square root of i Try to divide i by all odd numbers 3, 5, 7, etc. less than or equal to k If i is divisible by any of these numbers, then i is not prime To estimate the square root of a number, use the following algorithm: sqrtetnumber number sqrtest +sqrtest sqrtest- Stop iterating when the difference between the current and previous estimates is