title: Input an Integer and get its prime factors and duplicates
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5872962/prime-factors-in-c-sharp">Prime Factors In C#</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to get this coding to give me all the prime factors of the integer that is inputted, including its duplicates. I have this current code and it seems to be working sort of but it isn't showing all of it's prime factors and duplicates. Any help would be appreciated.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace _1_Numeric_Problem
  {
      class Program
      {
          static void Main(string[] args)
          {
              string myInput;
              int myInt;
              int p;
  
              Console.WriteLine(("Please input an integer"));
  
              myInput = Console.ReadLine();
              myInt = Int32.Parse(myInput);
  
              {
                  for (int i = 2; i &gt; 1; i++)
                  {
                      if (i == 100000)
  
                          break;
  
                      if (myInt % i == 0)
                      {
  
                          if (i &lt;= 3)
                          {
  
                              Console.Write("{0} ", i);
                              Console.ReadLine();
                              continue;
                          }
  
                          else
                          {
                              for (p = 2; p &lt; i; p++)
                                  if (i % p != 0)
                                  {
                                      Console.Write("{0} ", i);
                                      Console.ReadLine();
                                      return;
                                      Console.ReadLine();
                                  }
                                  else
                                  {
                                      p++;
                                      continue;
                                  }
  
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>