Possible Duplicate:
Prime Factors In C#
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.
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 > 1; i++)
{
if (i == 100000)
break;
if (myInt % i == 0)
{
if (i <= 3)
{
Console.Write("{0} ", i);
Console.ReadLine();
continue;
}
else
{
for (p = 2; p < i; p++)
if (i % p != 0)
{
Console.Write("{0} ", i);
Console.ReadLine();
return;
Console.ReadLine();
}
else
{
p++;
continue;
}
}
}
}
}
}
}
}