Solving challenges shows error

int N, divisor = 2;

	Scanner sc = new Scanner(System.in);
	N = sc.nextInt();
	boolean flag = true;

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

Can you add the problem link so that i can submit your code and help you.

https://online.codingblocks.com/player/9383/content/4775?s=1932

Hey Sonu, I guess this “CHECK PRIME” problem, so according to that if a number is not prime then you have to print “Not Prime” instead of “Non Prime”.

One more thing id the link you have provided is not accessible, so next time when you post a doubt please mention the question’s name also .

Hope this helps you :slight_smile: