Gauss law states that electric flux through any closed surface is equal to the net charge enclosed inside the surface divided by the permittivity of vacuum.
Electric field due to a uniformly charged thin shell:
In the diagram, O is the centre of the spherical shell of radius R, and charge enclosed by the spherical shell is q.
Let a point A is outside the spherical shell, where we have to calculate the electric field.The distance between the centre of spherical shell and the point A.
As per gauss law,
From equation (1) and (2)
This is the electric field at the distance r, outside from the shell.