Why I m not getting any o/p ?
Prime Sieve Not getting any output?
@namandubey20
how can you find nth prime number if you construct your sieve till n. let say n=4 if you construct
sieve till arr[4+1], you only get arr[2],arr[3] as prime number. You can never get 4th prime number in that case. So construct sieve till 10^7 in the beginning than start count.
Thanks I will make the changes.
mark it as resolved if you don’t have any other doubt. Thanks
Why I m getting RE now ?
I cann’t see any change in above code. Please create new file and save your updated code there and then share link
Getting RE for n=1 also
there are few mistakes in your code. fix them
1)line no 14 for(int i=3;i<10001;i+=2) run loop till 10001
2) change line 44 to { cout<<i<<endl; break; }
Done, still getting RE
@namandubey20
line 24 change it to cout<<i<<endl; break;
Also to pass all testcases, construct sieve till 9*10^7
Still getting Run Error(Segmentation Fault) even at small test cases like n=2,3 etc.
It’s still giving Run Error Segmentation Fault.
Awaiting your reply. It’s showing run error on both cb ide as well as code blocks.
@namandubey20
It is passing all testcase when i submitted the same code. Please submit it directly. It might give segmentation fault on cb ide due to limitation of memeory
Yes it’s submitting but why it’s giving Fault on codeblocks installed on my computer as well ?
@namandubey20
Actually there is limitation of memory in our system that’s why we can’t create array with that much large size. But at online judge, problem setter can increase the memory limit according to question. That’s why it is submitting successfully here.
ok Thanks 
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.