Find the integer that has the largest number of divisors and print the number of divisors for numbers in the range 1 to 100000. Use threads to solve this problem.
Sieve of Eratosthenes algorithm finds all prime numbers less than ‘n’ when ‘n’ is very large. The algorithm is given below. Algorithm: Create a list of natural numbers
Set k=2, the first unmarked number on the list Repeatedly do for k < sqrt (n)
a. Mark all multiples of k in the natural numbers list.
b. Find the next prime number i.e., the unmarked one and set it as k.
The unmarked numbers are primes.
Recall the producer consumer problem you studied in operating systems. Solve it using the multi threading concepts.