let x be no. of chickens and y be no. of cows
x+y = 15 <- no. of chickens + no. of cows ( let this be equation 1 )
2x + 4y = 50 <- 2 legs for chickens and 4 legs for cows ( equation 2 )
x=15-y - from equation 1 then substitute it to equation 2
2(15-y) + 4y = 50
30 - 2y + 4y = 50
2y = 50 - 30
2y = 20
y = 10
x = 5
there are 5 chickens and 10 cows :)