int n = int.Parse(textBox2.Text);
int Primes[n + 1];
for (int i = 0; i <= Sqrt(n); i++)
Primes[i] = 1;
Primes[0] = 0;
Primes[1] = 0;
for(int i = 2; i <= n; i++)
{
if(Primes[i] == 1)
{
for (int j = 2; i * j <= n; j++)
Primes[i * j] = 0;
}
}
The error is the subject!
I marked error code as red!
Is anyone know why?
Thanks