The ratio of girls to boys is 3 to 1, which means that for every 3 girls, there is 1 boy.
Let's assume the number of girls is 3x and the number of boys is x.
Therefore, the total number of students is 3x + x = 4x.
Given that the total number of students is 400, we can set up the equation:
4x = 400
Dividing both sides of the equation by 4, we get:
x = 100
Therefore, the number of boys is x = 100.