Prime Number : A Whole Numer (any number between zero to infinity, not
including decimals or fractions eg:1,2,...∞ ) that has
factors only 1 and itself.
Prerequestis : If you have an idea of how to code for a prime number,then
check it out this code .
CODE:
import java.util.Scanner;
import java.lang.*;
import java.io.*;
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
int n;
Scanner sc= new Scanner (System.in);
n = sc.nextInt();
if(n<=1)
System.out.println(" no p not comp");
else
{
int c =2;
while(c*c < n)
{
if(n%c==0)
{
System.out.println("not prime ");
System.exit(0); }
else
c++;
}