In a class of 20 student, 16 play soccer, 12 play hockey and 2 do not play any of the games.how many students play only hockey.

Let's use a Venn diagram to represent the information given:

We know that there are 20 students in total, so we can fill that in:

Next, we know that 2 students do not play any of the games, so we can fill that in:

Now we can fill in the number of students who play soccer and hockey. We know that a total of 16 students play soccer, and we also know that some of those students may also play hockey. Similarly, we know that 12 students play hockey, and some of those students may also play soccer. However, we don't know exactly how many students play both sports, so we'll leave that as a question mark for now:

Finally, we want to know how many students play only hockey. To figure this out, we need to subtract the number of students who play both sports from the total number of hockey players. We don't know how many students play both sports, but we can see from the diagram that there are 4 students who don't play soccer. These 4 students must be the ones who play only hockey (since they don't play soccer, but they do play hockey). So the answer is:

4 students play only hockey.

To find out how many students play only hockey, we need to subtract the number of students who play both soccer and hockey from the total number of students who play hockey.

Given:
Total number of students = 20
Number of students who play soccer = 16
Number of students who play hockey = 12
Number of students who play neither game = 2

To find the number of students who play only hockey, we need to subtract the number of students who play both games from the total number of students who play hockey.
Number of students who play only hockey = Number of students who play hockey - Number of students who play both soccer and hockey

Number of students who play both soccer and hockey = Number of students who play soccer + Number of students who play hockey - Total number of students

Number of students who play both soccer and hockey = 16 + 12 - 20
Number of students who play both soccer and hockey = 28 - 20
Number of students who play both soccer and hockey = 8

Number of students who play only hockey = Number of students who play hockey - Number of students who play both soccer and hockey
Number of students who play only hockey = 12 - 8

Therefore, the number of students who play only hockey is 4.