Answer:
A) Electric flux depends on the charge Q within and enclosed surface regardless of the shape of the surface - this concept is particularly useful for symmetric surfaces (centralized charge within a sphere) - field outside a uniform cylinder - whenever charges are symmetric with respect to the external environment.
B) Since the gravitational field has the same form as the electric field - F = G M1 M2 / R^2 the same arguments apply to the gravitational field - Field lines passing out thru an enclosed surface are sources of field whereas field lines passing inward thru an enclosed surface are sinks for the field