Whats wrong in my code ? how can i modify it

import java.util.Scanner;

public class Check_Prime {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
	boolean flag = true;
	// if (n > 1) {
	// flag = true;
	// }
	int i = 2;
	if(n > 1) {
		while (i <= n - 1) {
			if (n % i == 0) {
				flag = false;
			}
			i += 1;
		}
		if (flag == true) {
			System.out.println("Prime");
		} else {
			System.out.println("not Prime");
		}

	}

}

}

@Harsh_Sonwani Buddy there was a small typo, you wrote n as lowercase in not, take care of the print statements. Mark it resolved and rate full!

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
boolean flag = true;
// if (n > 1) {
// flag = true;
// }
int i = 2;
if(n > 1) {
while (i <= n - 1) {
if (n % i == 0) {
flag = false;
}
i += 1;
}
if (flag == true) {
System.out.println(“Prime”);
} else {
System.out.println(“Not Prime”); // Bro there was typo here n was lowercase.
}

}

}
}