Explanation:
x = number of birds
y = number of beasts
x + y = 43 (as each of these creatures had only 1 head).
2x + 4y = 120 (birds have 2 feet, beasts 4 feet).
x + 2y = 60 (divided both sides by 2)
so, second equation minus the first equation is
(x-x) + (2y-y) = 60-43
y = 17
x + y = 43
x + 17 = 43
x = 26
so, there are 17 beasts and 26 birds.