Each duck has 1 head and 2 legs. Each cow has 1 head and 4 legs.
Let x = number of ducks
y = number of cows
Then 1x + 1y = 65 ← heads
2x + 4y = 226 ← legs
Multiply the first equation by -2 and leave the second equation as is
-2x - 2y = -130
2x +4y = 226
Add the equations to obtain 2y = 96 So, y = 48
x = 17
There are 17 ducks and 48 cows.