Ducks have two legs and cows have four legs. Let d be the number of ducks and c be the number of cows. We can write a system of equations:
24 in total ==> c + d = 24 . (1)
66 legs ==> 4c + 2d = 66 . (2)
Multiply equation (1) by 2:
2c + 2d = 48
4c + 2d = 66
Subtract to get -2c = -18. So, there are 9 cows and 15 ducks.