Ducks have 1 head and 2 feet, where cows have 1 head and 4 feet.
Let's assume that the farmer has x numbers of ducks and y numbers of cows.
It is known that the animals he was having had the total of 12 heads and 44 feet. So, according of this
x + y = 12 (number of heads)
2x + 4y = 44 (number of feet)
Since, x+y=12, multiplying both side by 2 we get 2x+2y=24, or equivalently 2x=24-2y. Substituting this to the second equation we get
(24-2y) + 4y = 44
So, combining the y terms
24 + 2y = 44
Now substracting 24 from both sides
2y = 44 - 24 = 20
So, dividing both sides by 2
y = 10
So, there were 10 cows that the farmers had. Also, recalling that there was a total of 12 heads, and since the farmer had 10 cows, then there should be 2 ducks.
Thus, the farmer had 10 cows and 2 ducks.