How old are you? This problem can be solved so easily using algebra. If u are in high school and don't know how to do this, you're in big trouble.
Let x= number of pigs and y= number of chickens
x+y=43
4x+2y=96
43-y=x
4(43-y)+2y=96
172y-4y+2y=96
172-96=2y(4y-2y)
76=2y
38=y
5=x