Answer: There are 4 ducks and 2 sheep.
Step-by-step explanation:
Let x be the number of ducks and y be the number of sheep.
We know that each duck has 2 legs and each sheep has 4 legs.
Now, According to the given information , we have

Multiply 2 on both sides of equation (1), we get

Eliminate equation (3) from (2), we get

Substitute y=2 in (1), we get

Hence, there are 4 ducks and 2 sheep.