Step 1: Dispersion of sunlight
When sunlight passes through a prism, it gets split into different colours — a phenomenon known as dispersion.
Step 2: What colours are observed?
The seven colours visible in the spectrum of sunlight are:
Violet, Indigo, Blue, Green, Yellow, Orange, and Red. This is remembered using the acronym VIBGYOR.
Step 3: Evaluating options
(A) 10 $\Rightarrow$ Incorrect. Only 7 colours are observed.
(B) 8 $\Rightarrow$ Incorrect.
(C) 9 $\Rightarrow$ Incorrect.
(D) 7 $\Rightarrow$ Correct. VIBGYOR contains 7 distinct colours.
\[
\boxed{\text{Correct Answer: (D) 7}}
\]