According to Gauss's law, the electric flux through a closed surface is equal to $ \frac{1}{ \varepsilon_0} $ times the net charge enclosed by the surface. Since, q is the charge enclosed by the surface, then the electric flux $ \phi = \frac{q}{ \varepsilon_0} $
If charge q is placed at a comer of cube, it will be divided into 8 such cubes. Therefore, electric flux through the cube is
$ \phi ' = \frac{ 1}{ 8} \bigg( \frac{q}{ \varepsilon_0} \bigg) $