title: Armstrong Number in C#
body: <p>I wrote this program in C# to generate Armstrong numbers.I know the addition of extra method is unnecessary but it's something I've just learnt and have been practicing . So the generator only shows number till 9 no matter how large of a limit I give. </p>
  
  <pre><code>using System;
  
  namespace ArmstrongNumberGenerator
  {
      class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine("Enter the maximum limit for searching");
              int max = Convert.ToInt32(Console.ReadLine());
              for (int i = 1; i &lt;= max; i++)
              {
                  if (isArmstrong(i))
                      Console.WriteLine(i);
              }
              Console.ReadLine();
          }
  
          static bool isArmstrong(int x)
          {
              int temp = x;
              int sum = 0;
              while (x!=0)
              { sum = sum + x % 10;
                  x = x / 10;
              }
  
              if (sum == temp)
                  return true;
              else
                  return false;
          }
      }
  }
  </code></pre>
  
  <p>I can't see what I am doing wrong.</p>