Подкорректировать код для вывода 1000 простых чисел - C#
Формулировка задачи:
Код для вывода 1000 простых чисел
Скажите,почему здесь if (c < 1) начинается с 1,а не с 2,3 или 4?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int c = 0;
for(int a=2,n=1;n<=1000;a++)
{
c = 0;
for(int b=2;b<a;b++)
if(a%b==0)
{
c++;
}
if (c < 1)
{
Console.Write("{0}\t", a);
n++;
}
}
Console.ReadLine();
}
}
}Решение задачи: «Подкорректировать код для вывода 1000 простых чисел»
textual
Листинг программы
for (int i = 2; i <= Math.Sqrt(n); i++)