Step 1: Write Gauss' law in words and symbols.
The surface integral of the electric field over a closed surface is \(\frac{1}{\varepsilon_0}\) times the charge trapped inside it: \(\Phi=\oint \vec{E}\cdot d\vec{A}=\dfrac{q_{enc}}{\varepsilon_0}\).
Step 2: Insert the condition.
With \(q_{enc}=0\) the right side vanishes, hence \(\Phi=0\). So the same number of field lines enter and exit the surface.
Step 3: Separate flux from field.
Flux is a summed (integrated) quantity, while field intensity is a local (point) quantity. A vanishing sum can be built from non-zero local values that cancel. Therefore a zero total flux is fully consistent with a finite \(\vec{E}\) at each surface point produced by external charges.
Step 4: State the exception.
Only when there is no charge anywhere (inside or outside) is \(\vec{E}=0\) everywhere on the surface.
\[\boxed{q_{enc}=0 \Rightarrow \Phi=0,\ \vec{E}\ \text{can still be non-zero}}\]