Shown below is a distribution of charges. The flux of electric field due to these charges through the surface S is
According to Gauss's theorem, the electric flux through any closed surface is equal to times the net charge q enclosed by the surface, that is
Since total charge enclosed by surface is zero,
Total electric flux, = 0