Prateek loves candy doubt

how to approach this question as i take the input say 5 i am only able to print prime numbers less than 5 but in this question i have to find all the first 5 prime numbers and then print the last prime number. i dont know how to do this. plzz help

In this question you have to make an array of prime numbers like we have done in sieve method.

But i haven’t studied arrays yet and this question is in my basics challenge

method of seive will be applied on this question, you can wait till you reach arrays and then try to solve this problem. Till then solve other problems.

Hey Himanshu, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.