Simply... replace this code ...
Mohan Mehra wrote:
with something that does this...
Mohan Mehra wrote:independently generate a random integer as an upper limit, and then computes and prints the no. of primes less than or equal to that upper limit .
Also, modify this code ...
Mohan Mehra wrote:
to start many threads by adding ...
Jeff Verdegan wrote:
So use a loop.
whose range is controlled or obtained ...
Mohan Mehra wrote:if you mention 5 then 5 threads have to be generated.
from some input source.
Also ... Since most, if not all of this problem is not thread related, it may be best to implement and
test the components without threads first. So, do you have code that generates a random number? that gets input from a user? that generate prime numbers?
Henry