My code of this program is not submitting. After compiling and getting compiled successfully, when clicking on submit, it processes and after few seconds stops.
My code:
import java.util.Scanner;
public class PrateekLovesCandy {
public static void main(String[] args) {
Scanner scn=new Scanner(System.in);
int f=0;
while(f==0)
{
int T=scn.nextInt();
if(T<=10000)
{
f=1;
for(int i=1;i<=T;i++)
{
int count=0,j=2;
int N=scn.nextInt();
while(count!=N)
{
boolean c=true;
for(int k=2;k<=j/2;k++)
{
if(j%k==0)
{
c=false;
break;
}
}
if(c==true)
{
count++;
}
j++;
}
System.out.println(j-1);
}
}
}
}
}