### There are 30 students in a class. The average age of first 10 students is 12.5 years. The average age of the remaining 20 students is 13.1 years. The average age (in years) of the students of the whole class is :

A. 12.5 years

B. 12.7 years

C. 12.8 years

D. 12.9 years

$\begin{array}{l}\text{According to the question}\\ \text{Average of whole class}\\ =\Large\frac{10\times12.5+20\times13.1}{30}\\ =\Large\frac{125+262}{30}\\ =\Large\frac{387}{30}\\ =12.9\text{ years }\end{array}$