Number of girls in the class = 18
Ratio of boys and girls = 4 : 3
According to the question,
BoysGirls = 45
Boys18 = 45
Number of boys = (4 × 18)3=24
So, there are 24 boys and 18 girls in the class.
Therefore, total number of students = 24 + 18 = 42.