Computer Science, asked by rivu37, 1 year ago

please write a java program for palindrome

Answers

Answered by zaidkhan620305
2
Class PalindromeExample{  

 public static void main(String args[]){  

  int r,sum=0,temp;    

  int n=454;//It is the number variable to be checked for palindrome  

  

  temp=n;    

  while(n>0){    

   r=n%10;  //getting remainder  

   sum=(sum*10)+r;    

   n=n/10;    

  }    

  if(temp==sum)    

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

  else    

I hope this answer is helpful to u
Please mark it brainiest answer

zaidkhan620305: mark a brainliest dear
rivu37: thanks
zaidkhan620305: ur welcome
Similar questions