import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int flag =1;
if(n>2 && n<=1000000000)
{
for(int i=2;i<n;i++)
{
if(n%2==0)
{
flag=1;
System.out.println(“Prime”);
}
else
{
if(flag==0)
System.out.println(“Not Prime”);
}
}
}
}
}
Please help me with this one
@Poulomi,
you have written n%2 ==0 , it should be n%i ==0.
Also, the print statements will be outside the for loop.
https://ide.codingblocks.com/s/279468 corrected code.