a farmer had 24 animals. some of the animals were chicken and some were dogs. altogether there were 56 legs.

How many of the farmer's animals were chickens and how many were dogs?

c + d = 24

Therefore c = 24 - d

2c + 4d = 56

Substitute 24-d for c in second equation and solve for d. Insert that value into the first equation and solve for c. Check by inserting both values into the second equation.

3 pigs

21 Chickens

21 chicken and 3 dogs

To find the number of chickens and dogs, we can set up a system of equations using the given information.

Let's assume that the number of chickens is represented by 'c' and the number of dogs is represented by 'd'.

We know that the total number of animals is 24, so we can write the equation:
c + d = 24 (equation 1)

We also know that the total number of legs is 56, considering that chickens have 2 legs and dogs have 4 legs. So we can write another equation:
2c + 4d = 56 (equation 2)

Now we have a system of two equations with two variables. We can solve this system to find the values of 'c' and 'd'.

Solving equation 1 for 'c', we get:
c = 24 - d

Substituting this value of 'c' into equation 2, we get:
2(24 - d) + 4d = 56
48 - 2d + 4d = 56
2d = 56 - 48
2d = 8
d = 8/2
d = 4

Now we know that there are 4 dogs on the farm. Substituting this value into equation 1, we can find the number of chickens:
c + 4 = 24
c = 24 - 4
c = 20

Therefore, the number of chickens is 20 and the number of dogs is 4.