Computer Science, asked by dikshajadhav51, 8 months ago

Write a program to accept a number and check if its a palindrome number (in java)
ex.revrse of number and original number is same = 131 = 131
icse class 10th
i will mark you brainliest and follow you if you give me a correct answer

Answers

Answered by Anonymous
0

Explanation:

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     System.out.println("not palindrome");    

}  

}

Similar questions