Let g be the number of grandchildren, and d be the number of dogs. They both have only one head, so the number of heads is
[tex]g+d=33[/tex]
Grandchildren have 2 legs, while dogs have 4. So, the total number of legs is
[tex]2g+4d=84[/tex]
From the first equation (the one for the heads) we can derive
[tex]g=33-d[/tex]
Substitute this into the second to get
[tex]2g+4d=84 \implies 2(33-d)+4d=84 \iff 2d=18 \iff d=9[/tex]
So, there are 9 dogs and (from the first equation
[tex]g=33-9=24[/tex]