There are 40 cows and chickens in a farmyard. One quiet afternoon, Lola counted and found that there were 100 legs in all. How many cows and how many chickens are there?

thx...

if there are c chickens, then there are 40-c cows. So, adding up the legs,

2c + 4(40-c) = 100