This is a kind of a problem that includes partitive proportion.
3 + 5 = 8
40 ÷ 8 = 5
5 × 3 = 15
5 × 5 = 25
Therefore, the ratio will become 15:25 = 3:5
Check:
15 + 25 = 40
Also, your problem is incomplete but it's okay.. we have no ideas if the ratio of 3:5 is the ratio of boys to girls or girls to boys.