What happens when secondary colors like yellow,green and magenta are passed through a prism? Will it split into its component colors(for example yellow split into green and red)?If yes why we are observing secondary colors in the visible spectrum obtained when white light(composite light) is passed through a prism?
"Yellow light" is an ill-defined concept. Our eyes can perceive as yellow both monochromatic light (at, say, 570 nm) as well as combinations of red and green light; depending on the mix of wavelengths and intensities the human-perceived color can be intistinguishable in the two cases.
Passing such light through a prism is, in fact, the best way to distinguish which of the two cases you have: monochromatic yellow light will just bend, whereas a mixture of different wavelengths will split at a prism. However, you can't tell which one will happen just by looking at the light.