import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.println("Check prime number or not \nenter a number");
int user = sc.nextInt();
if (user % 4==0 || user % 3==0)
/*its a mine logic but generally prime
number formula is =6n+1 if in end 2or 3 come then its a prime no
*/
System.out.println("not a prime number");
else
System.out.println("yes it is a Prime number");
// while ()
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: