The total number of students in the class is not given in the question
so can't answer to this
Suppose,
The total number of students in the class is 100
Let number of boys are x and then number of girls = (100-x).
Thus,
50x+(100-x)*40 = 46*100
→ x = 60.
Number of boys = 60.
Number of girld = 100 - 60 = 40
So the ratio is 6:4