Let:
* `p` represent the number of pigs
* `c` represent the number of chickens
Set up the equations:
* Equation 1 (Total animals): p + c = 220
* Equation 2 (Total legs): 4p + 2c = 700 (Pigs have 4 legs, chickens have 2)
Solve for the variables:
1. Solve for 'p' in Equation 1:
p = 220 - c
2. Substitute this value of 'p' into Equation 2:
4(220 - c) + 2c = 700
3. Simplify and solve for 'c':
880 - 4c + 2c = 700
-2c = -180
c = 90
4. Substitute the value of 'c' back into Equation 1 to find 'p':
p + 90 = 220
p = 130
Answer: The farmer has 130 pigs and 90 chickens.