Let the number of boys in the class be ‘B’ and the number of girls be ‘G’. Then we know that:

B + G = 100 …(1) (total number of students in the class)

Also, we know that the mean weight of 100 students in the class is 46 kg. This means that the total weight of all the students in the class is:

Total weight of 100 students = Mean weight x Total number of students = 46 kg x 100 = 4600 kg

Now, we are given that the mean weight of boys is 50 kg and the mean weight of girls is 40 kg. So, the total weight of all the boys in the class is:

Total weight of boys = Mean weight of boys x Number of boys = 50 kg x B

Similarly, the total weight of all the girls in the class is:

Total weight of girls = Mean weight of girls x Number of girls = 40 kg x G

Since the total weight of all the students in the class is 4600 kg, we can write:

Total weight of boys + Total weight of girls = 4600 kg

Substituting the above expressions, we get:

50B + 40G = 4600

Now, we have two equations with two variables (equations (1) and (2)), which we can solve simultaneously to find the values of ‘B’ and ‘G’. Multiplying equation (1) by 40 and subtracting it from equation (2) gives:

50B + 40G – 40B – 40G = 4600 – 4000 10B = 600 B = 60

Therefore, the number of boys in the class is 60.