Answer
The number of years eating: $4.$
The number of years sleeping: $28.$
Work Step by Step
The number of years eating: $ x $
The number of years sleeping: $ x+24$
Total = $ x+(x+24)=2x+24.$
We are given that the total is $32$.
$ 2x+24=32 \qquad $ ... subtract $24$
$2x=32-24$
$ 2x=8 \qquad $ ... divide with 2
$ x=4$
$(x+24=4+24=28)$
The number of years eating: $4.$
The number of years sleeping: $28.$