// prime or not
import java.io.*;
class ssva30
{
public static void main(String arg[]) throws IOException
{
int n,i,p=1;
BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
System.out.print("\n\t\t\tChecking the Number is prime or Not");
System.out.println("\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.print("\nEnter the Value of N: ");
n=Integer.parseInt(inp.readLine());
for(i=2;i<n;i++)
{
if(n%i==0)
p=0;
}
if(p==0)
System.out.print("\nThis is not Prime Number\n");
else
System.out.print("\nThis is Prime Number\n");
}
}In this program, easy to understand to calculate the given number is prime or not using Java Program
