title: I want to find the largest product of 2 3-digit number that is a palindrome, and my algorithm isn't finishing even though it should
body: <p>I have written the following code in C#. I have looked at it in every way and I think it should work but it isn't giving any output even though I let it running overnight. What is the issue? Thanks in advance.</p>
  
  <pre><code>namespace Palymdrome
  {
      class Multiple
      {
          private int x;
          private int y;
  
          public int ProductY
          {
              get
              {
                  return y;
              }
  
              set
              {
                  y = value;
              }
  
  
          }
          public int ProductX
          {
              get
              {
                  return x;
              }
              set
              {
                  x = value;
              }
          }
          public int Value
          {
              get
              {
                  return x * y;
              }
          }
  
          public Multiple(int x, int y)
          {
              this.x = x;
              this.y = y;
          }
      }
  
  
      class Program
      {
          static bool IsPalimdrome(int palimdrome)
          {
              string sPalimdrome = palimdrome.ToString();
              int decrescent = sPalimdrome.Length-1;
              string sInverted = "";
              for (decrescent=sPalimdrome.Length-1;decrescent&gt;=0;decrescent--)
              {
                  sInverted += sPalimdrome[decrescent];
              }
  
              if (sPalimdrome == sInverted)
              {
                  return true;
              }
  
              return false;
          }
  
          static void Main(string[] args)
          {
              Multiple multiple = new Multiple(999, 999);
              int[] values = new int[999999];
              int i = 0;
  
              while (multiple.ProductY &gt; 0)
              {
                  multiple.ProductX--;
                  if (multiple.ProductX == 0)
                  {
                      multiple.ProductY--;
                      multiple.ProductX = 999;
                  }
  
                  if (IsPalimdrome(multiple.Value) &amp;&amp; multiple.Value != 0)
                  {
                      values[i] = multiple.Value;
                      i++;
                  }
  
                  /*if (multiple.ProductY &lt; 10)
                  {
                      Console.WriteLine("100 reached, waiting for confirmation");
                      Console.Read();
                  }*/
  
  
  
              }
  
              Console.WriteLine(values.Max());
              Console.Read();
  
  
          }
      }
  }
  </code></pre>