Elastic and inelastic scattering of carbon ions at intermediate energies