Under what conditions can the electric flux be found through a closed surface?
We should know the total charge inside. There is no contribution in the flux due to outside charges. Also, we should know both magnitude and direction of electric field at any point on the surface.