Deepak and Prime: Print the nth Prime number
HI rachit… The n is 500000 means that the count u are using can have a max value of 500000 not that u can loop till 500000 … You have to print the nth prime number not the prime number before the nth natural number.
Hello! I don’t understand can you please elaborate?
Yes,
You have done everything right but ur range is small. If the user gives input n=500005 and ur are running a loop till 500005 it will surely give wrong because there are not 500005 prime numbers less than 5000005
1 Like