using System.Collections;
static int MAX_SIZE = 1000005;
static ArrayList primes = new ArrayList();
static void SieveOfEratosthenes()
bool [] IsPrime = new bool[MAX_SIZE];
for(int i = 0; i < MAX_SIZE; i++)
for (int p = 2; p * p < MAX_SIZE; p++)
for (int i = p * p; i < MAX_SIZE; i += p)
for (int p = 2; p < MAX_SIZE; p++)
public static void Main ()
Console.WriteLine("ENTER NUM");
int number = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(" prime number is " +