The effect of sheared flows on the m = 0 instability development in a z-pinch is numerically investigated using a 2D magnetohydrodynamic (MHD) code. The behavior of both internal and free-boundary modes is studied by using two types of initial configurations: a diffuse Bennett equilibrium and a free-boundary parabolic equilibrium. It was found that sheared flows change the m = 0 development by reducing the linear growth rates, decreasing the saturation amplitude, and modifying the instability spectrum. Full stability can be obtained for supersonic plasma flows, but a larger shear is needed to obtain stabilization of free-boundary modes.