In a class of 45 students, it is known that 24 of them do art, 20 do chemistry and 22 do biology, and 8 chemistry and biology. How many do two subjects only?

To find out how many students do two subjects only, we need to subtract the number of students who do three subjects from the total number of students who do two or more subjects.

To start, let's find the number of students who do three subjects.

We know that:
- 24 students do art
- 20 students do chemistry
- 22 students do biology
- 8 students do both chemistry and biology

To find the number of students who do three subjects, we can add the number of students who do each subject and then subtract the number of students who do both chemistry and biology, because they were counted twice.

So, the number of students who do three subjects = (number of students who do art) + (number of students who do chemistry) + (number of students who do biology) - (number of students who do both chemistry and biology)

= 24 + 20 + 22 - 8
= 58 - 8
= 50

Now, to find the number of students who do two subjects only, we subtract the number of students who do three subjects from the total number of students.

Total number of students = 45
Number of students who do two or more subjects = 50

Number of students who do two subjects only = Total number of students - Number of students who do two or more subjects

= 45 - 50
= -5

Since we can't have a negative number of students, it means there was likely an error in the given information or the calculation. Double-checking the numbers and the problem statement is advised.