  Consider a surface $M^2$ with Gaussian curvature either $< 0$ or $> 0$. We
prove that in $M^2\times \mathbb{R}^n$ cylinders are characterized as the
hypersurfaces with both the extrinsic and intrinsic curvatures equal to zero.
