title: Keep Reversing the no. & adding it to the original no. until there is a Palindrome Number
body: <p><strong>It's not <em>"Find the Palindrome of a Number"</em></strong> ! it's a bit twisted than that:</p>
  
  <p>Step 1: Reverse the digits of a original number. </p>
  
  <p>Step 2: Add the reversed number.</p>
  
  <p>Step 3: If the new number is a palindrome number then print the output.</p>
  
  <p>The limit is 15 steps &amp; we can print the original number if that is a palindrome in itself.  We have to use function calling in this program. Here I have used two functions() - FIRST to reverse the number &amp; SECOND to add the original number and the reversed number &amp; check if the sum is a Palindrome or not. </p>
  
  <p><strong>Please suggest your opinions if I can improve this long code in any way.</strong></p>
  
  <p>PS: newbie in Java &amp; especially function calling!</p>
  
  <p>Thank you!! Here's the code, it's a little bit long! I am sorry :( </p>
  
  <pre><code>import java.util.*;
  public class PalindromicNumber
  {
   public int PalinReverse(int n)
      {
       int n1=n;
       int x1=0, d1=0;
        while (n1&gt;0)//just used to store the reverse of the original number
          {
            d1=n1%10;
            x1=(x1*10)+d1;
            n1=n1/10;
          }
      return x1;
       }
  
      public int PalinCheck (int n, int p)
        {
           int F=0;
           F=n+p; 
           int n1=F, x1=0, d1=0;
  
            while(n1&gt;0)//checks if the sum of reversed no. and the original number is palindrome or not
             {
              d1=n1%10;
              x1=(x1*10)+d1;
              n1=n1/10;
             }
     if (x1==F)
         {
         System.out.println("The number"+ F +"is a Palindrome");
         return 1;
         }
     else 
         return F; //returns the sum if it is not a palindrome
      }
  
     public static void main (String args[])
       {
        Scanner sc=new Scanner(System.in);
        PalindromicNumber ob=new PalindromicNumber();
  
        System.out.println("Enter the original number");
        int n=sc.nextInt();
  
        int count=0;
        int n1=n, x1=0, d1=0;
          while(n1&gt;0) //this checks if the original no. is a palindrome or not
             {
              d1=n1%10;
              x1=(x1*10)+d1;
              n1=n1/10;
             }
  
          if (x1==n)
          System.out.println("The original number="+n+"is a palindrome number");
  
          else
  
          for (count=0;count&lt;15;count++)
             {
                 int a=ob.PalinReverse(n);
                 System.out.println("The reversed number is"+a);
                 int b=ob.PalinCheck(n,a);
                  if(b==1)
                  {
                      System.out.println("The no. of steps it took was"count+1);
                      break;// the palindromic no. is now found out
                  } 
                  else 
                       n=b;//used to update the value of n
             }
      }
  }
  </code></pre>