تبلیغات
 int i, count = 0;
            for(i=1;i<10000;i++)
            {
                count=0;
                for(int j=1;j<=i;j++)
                {
                if(i%j==0)
                    count++;
                }
                if (count == 2)
                    listBox1.Items.Add(i);
            }