What is an asteroid made out of?

the asteroids that are nearest to the sun is mostly made out of carbon while the ones further away are made out of silicate rock