Advertise with us

What is palindrome number?

For example-

141, 555, 989, 343, 5656, etc. In string- Nitin, Madam, etc.

Last updated:7/16/2019 11:11:36 PM

1 Answers

Harsh Srivastava
Harsh Srivastava

Palindrome Number-

Palindrome number is a number that is same in reverse.

For example-

141, 555, 989, 343, 5656, etc. In string- Nitin, Madam etc.

class Read


{

 public static void main(String args[]){

  int r,sum=0,temp;

  int n=595;

  temp=n;

  while(n>0)

{

   r=n%10;

   sum=(sum*10)+r;

   n=n/10;

  }

  if(temp==sum)

   System.out.println("palindrome number ");

  else

   System.out.println("not palindrome");

}

}
Output-
palindrome number.

Answer