Prateek loves candy prime

I not get the question

Hi Dhruv,
In Simple Terms,
We have to output to nth Prime number.
Now Consider n=5;
The 5th prime number is 11,
for n=6,its 13.
and son on.
I hope this will help.

how to solve this problem

@Dhruv-Goyal-449223618988467
Lets discuss the approach stepwise:

  1. need to take input n.
  2. need to know an efficient algorithm,for generating primes.
  3. After generating these primes,store in an Array or ArrayList.
  4. Print the nth prime out of the Array or ArrayList.
    For efficient algorithm,for Primes have a look here,
    https://www.geeksforgeeks.org/sieve-of-eratosthenes/

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.