The total flux through the cylinder is zero.
In fact, the electric flux through a surface (for a uniform electric field) is given by:
where
E is the intensity of the electric field
A is the surface
is the angle between the direction of E and the perpendicular to the surface, whose direction is always outwards of the surface.
We can ignore the lateral surface of the cylinder, since the electric field is parallel to it, therefore the flux through the lateral surface of the cylinder is zero (because and ).
On the other two surfaces, the flux is equal and with opposite sign. In fact, on the first surface the flux will be
where r is the radius, and where we have taken since the perpendicular to the surface is parallel to the direction of the electric field, so . On the second surface, however, the perpendicular to the surface is opposite to the electric field, so and , therefore the flux is
And the net flux through the cylinder is