X+y=36
4x+2y=104
Then
X=16, y=20. 16 cows and 20 chicken.
Or
104 legs minus 2 times 36 heads and then divided by 2 is the number of cows. (From all legs minus all legs for chicken and 2 legs of each cow. The result is 2 legs per cow. So divided by 2 is the number of cows).
X=(104-2*36)/2=16
Y=36-16=20