C is chickens and P is pigs. Each animal has one head so C + P = 200.
Chickens have two legs, so for legs chickens add 2*C (2 times the number of chickens.) Pigs have four legs, so for legs pigs add 4*P. 2C + 4P = 540.
From the first equation solve for C: C = 200-P. Substitute that into the second equation.
2(200-P)+4P = 540
400 -2P + 4P = 540
2P = 140
P = 70.
C = 200-70=130.
Hope the solution helped. Sometimes you need more than a solution. Contact fcabanski@hotmail.com for online, private tutoring, or personalized problem solving (quick for groups of problems.)