Teat case 5 is not passing issue in my code

#include
using namespace std;

void prime(bool prime_table[])
{
for(int i=2;ii<=100000;i++)
{
if(prime_table[i]==0)
{
for(int j=i
i;j<=100000;j+=i)
prime_table[j]=1;
}
}
}
int main()
{
int test;
cin>>test;
bool prime_table[100000]={1,1};
prime(prime_table);
while(test–)
{
int n;
cin>>n;
int i=2;
while(n!=0)
{
if(prime_table[i]==0)
n–;
i++;
}
cout<<i-1<<endl;

}

}

@Nidhi_Alipuria it is giving you TLE because for every test case you are running a while loop of order(n).
try to think of an efficient approach.

still not working…

updated your code a little bit look here https://ide.codingblocks.com/s/220255