Please find my code
package challenges_CB_1;
import java.util.Scanner;
public class Ques7 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
boolean flag = true;
int count = 0;
int j = 0;
int n1 = 50;
for(int i=0; i<t;i++) {
int n = sc.nextInt();
if (n<=1) {
flag = false;
}
for( j=2 ; j<n;j++) {
if(n%j==0) {
flag = false;
}else {
flag = true;
count++;
}
}
System.out.println(flag);
}
}
}