int count = 0;
int z=0;
int a = int.Parse(textBox1.Text);
for (int i = 1; i <= a; i++)
{
if (a % i == 0)
count++;
for (int j = 1; j <= a; j++)
{
if (i * j == a)
z = j*i;
}
}
if (count > 2)
MessageBox.Show("Not Prime " + z);
else
MessageBox.Show("Prime");
now i want to know if the number is not prime so what number can divide into .... thanks for the help
now i want to know if the number is not prime so what number can divide into .... thanks for the help


VulpesRank #55 · 29.2K reputationPosted Jan 11, 2015, 10:15 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 11, 2015, 7:31 AM EST
Donovan IT24 reputationPosted Jan 11, 2015, 9:59 AM EST