my Sieve code id working till 10000, here is the code
#include
using namespace std;
int n=10000;
void primesieve(int *p)
{
p[0]=p[1]=0;
p[2]=1;
for(int i=3;i<n;i+=2)
p[i]=1;
for(int i=3;i<n;i+=2)
{
if(p[i])
{
for(int j=ii;j<n;j+=(2i))
p[j]=0;
}
}
}
int main() {
//int N=100000;
int p[n]={0};
primesieve§;
int k,sum=0;
cin>>k;
for(int i=0;i<n;i++)
{
sum=sum+p[i];
if(sum==k)
{cout<<i;
break;}
}
return 0;
}
This is the code taught by deepak bhaiya , please tell me errors and modifications to be done to make it run for 10^6.