Deepak and prime runtime error
Plz make following changes in your code : Take the size of array as
long long int N=90000000;
long long int p[N];
Make separate function of type void as :
primeseive(p,N);
and use this function before taking the value of input , and then in the main , use
for(long long int i=2;i<=N;i++)
{
if(p[i])
{
cnt=cnt+1;
}
if(cnt==nth)
{
cout<<i<<endl;
break;
}