Add

Palindrome Number program in java

9:52:00 AM Rohit Kumar Verma 0 Comments

Palindrome Number program in java

Palindrome number is same if it is reversed as well. live 121,212.12321, etc.


///Program Starts

class PalindromeNumber{
 public static void main(String args[]){
  int remainder,sum=0,temp,input=454;  //input to check the number.  

 
  temp=input;  
  while(input>0){  
   remainder=input%10;  // we get remainder
   sum=(sum*10)+remainder;  
   input=input/10;  
  }  
  if(temp==sum)  
   System.out.println("palindrome number ");  
  else  
   System.out.println("not palindrome");  
}
}

///Program Ends

0 comments: