Study of the high-lying states of 12C by inelastic scattering of hadrons