I have made the prime sieve but i dont know the logic of printing the answer

i have made the prime sieve but i dont know the logic of printing the answer

you can place a counter up to n
refer this code for better understanding :- https://ide.codingblocks.com/s/249534

what’s wrong in this??I have used the pre computed array

should declare the size of prime array to atlest 10^7 to accomodate 500000 prime numbers
refer :- https://ide.codingblocks.com/s/249586

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.