Final answer:
To find the number of students who like both music and dancing, subtract the number of students who like neither from the total number of students, then add the number of students who like music and the number of students who like dancing, and subtract the number of students who like both.
Step-by-step explanation:
To find the number of students who like both music and dancing, we can start by subtracting the number of students who like neither from the total number of students. There are 60 students in total and 5 students who like neither, so there are 60 - 5 = 55 students who like either music, dancing, or both.
Next, we can add the number of students who like music and the number of students who like dancing and then subtract the number of students who like both. There are 45 students who like music, 50 students who like dancing, and we want to find the number of students who like both.
So, the number of students who like both music and dancing is 45 + 50 - 55 = 40 students.