Let's assume
number of chickens =c
number of pigs =p
He counted 60 heads
each pig has one head and each chicken has one head
so, we get equation


He counted 176 legs
Chicken has two legs
pigs has four legs
so, we get equation as


so, we get two equations as


we can eliminate any one variable from first equation and plug that in second equations and then we can solve for c and p
solve for c

plug this into second equation

now, we can solve for p




now, we can solve for c


so,
number of chickens are 32
number of pigs are 28...............Answer