You are on page 1of 2

PRIME PALINDROME NUMBER

import java.util.*;

class primerev

void pp(int mn)

int temp1,temp2;

int r1,rev = 0;

int i,j,k,l;

int count = 0;

temp1 = mn;

for(i = 2;i<=temp1;i++)

if(temp1%i==0)

count++;

else

count = 0;

if(count==1)

while(temp1>0)

r1 = temp1%10;
rev = rev*10+r1;

temp1 = temp1/10;

if(rev==mn)

System.out.println("The number is PRIME PALINDROME");

else

System.out.println("The number is prime palindrome");

else

System.out.println("The number is not prime");

public static void main()

Scanner scn = new Scanner(System.in);

System.out.println("Enter the number");

int fn = scn.nextInt();

primerev rsh = new primerev();

rsh.pp(fn);

You might also like