how to calculate prime number if range is like 1000000000
cant able to declare that much size of array segmentation fault is coming
Prime visit question
Try Dynamic Memory Allocation
used vector and able to use vector till 100000000 after this if i increasing size program not working in ide …
Vector and arrays are static memory allocation. For declaring arrays of such large sizes, we use dynamic memory allocation.
tried this also but not working
In prime visits question, sieve of size 5000000 will give you correct answer. And it can done using static memory allocation only.
Sir i am not asking about particular question I am asking in general like in one question I was supposed to find out 5000000th prime number so 100000000 size array will work and if I want 10000000th prime number then need more size array then how to do it that is my question…
Well you won’t be asked to find such large prime numbers
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.