Chickens and rabbits in the same cage: there are 100 chickens and rabbits, 40 more feet than chickens, how many chickens and rabbits each? (use equation)

Chickens and rabbits in the same cage: there are 100 chickens and rabbits, 40 more feet than chickens, how many chickens and rabbits each? (use equation)

There were x rabbits and 100-x chickens
4x-2(100-x)=40
4x-200+2x=40
6x=240
x=40
100-40=60
A: 60 chickens and 40 rabbits