ques:-https://practice.geeksforgeeks.org/problems/sieve-of-eratosthenes5242/1
solution:-https://ide.codingblocks.com/s/406052
Test case not pass
Hello @prashantgupta9876 i have corrected your code and commneted the mistake:
if you have any doubt you can ask here:
happy Learning!!
why we have take n+1 size i prine array
@prashantgupta9876 suppose you have to print the numbers till 10.
so for that if you want to check for all element from 0 to 10 then there are totals of 11 elements to check.
Okay , got it , thanks for helping
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.