Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ls {
- public static void main(String[]args){
- Scanner kb = new Scanner(System.in);
- int num1;
- System.out.print("enter a number : ");
- num1 = kb.nextInt();
- if(num1%2==0){
- System.out.print("the number is not a prime number\n");
- }
- else if(num1%3==0){
- System.out.print(" number is not a prime number\n");
- }
- else {
- System.out.print("the number is a prime number\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement