Sir
How do i rectify problem in this:
Scanner obj = new Scanner(System.in);
int t = obj.nextInt();
if (t <= 10000) {
int[] arr = new int[100000];
int k = 0, count = 0;
arr[count] = 2;
for (int m = 3; m <= 1000000; m++) {
for (int j = 2; j < m; j++) {
k = m % j;
if (k == 0) {
break;
}
}
if (k != 0) {
count += 1;
arr[count] = m;
}
}
for (int i = 1; i <= t; i++) {
int n = obj.nextInt();
System.out.println(arr[n - 1]);
}
}