Please tell my mistake my test case 3 shows wrong answer

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int N = 1;
while(N<2 && N>1000000000)
{
N=scn.nextInt();
}

	int divisor = 2;
	boolean flag = true;
	while (divisor <= N-1) {
		if (N % divisor == 0) {
			flag = false;
		}
		divisor = divisor + 1;
	}
	if (flag == true) {
		System.out.println("Prime");

	} else {
		System.out.println("Not Prime");
	}

}

}

actually ur passes some test case by mistake.

becoz initially u have initailized the N with 1
and then u taking the input in while loop which never going to execute
becoz ur N never going to >2 ( initialised N =1)

ur code will print Prime.
see the changes which i have made in ur code:

hope this will help u
and pls rate my work so that i can improve my work.

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int N = scn.nextInt();

int divisor = 2;
boolean flag = true;
while (divisor <= N-1) {
	if (N % divisor == 0) {
		flag = false;
	}
	divisor = divisor + 1;
}
if (flag == true) {
	System.out.println("Prime");

} else {
	System.out.println("Not Prime");
}

}
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.