answersLogoWhite

0

import java.io.*;

public class chuva

{

public static void main(String[] args) throws Exception

{

BufferedReader x = new BufferedReader(new InputStreamReader(System.in));

int rem, quo, rev=0;

System.out.println("Enter a number: ");

int a = Integer.parseInt(x.readLine());

int b=a;

for(int ctr=0; ctr<=a; ctr++)

{

rem = a%10;

a = a/10;

rev = rev*10 +rem;

ctr=0;

}

System.out.println(+rev);

if(b==rev)

System.out.println("Palindrome");

else

System.out.println("Not Palindrome");

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?