Initialize all entries of prime it as true a value in prime [ i ] will finally be false if i is Not a prime , else true .
for ( int i = 0 ; i < prime . Length ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= MAX ; p ++ ) {