chickens have 1 head and 2 legs
rabbits had 1 head and 4 legs
total heads is 30
c+r=30
total legs is 98
2c+4r=98
divide by 2
c+2r=49
multiply top equation by -1 and add to 2nd equation
-c-r=-30
c+2r=49 +
0c+1r=19
r=19
sub back
c+r=30
c+19=30
minus 19
c=11
11 chickens
19 rabbits