Let the number of tomato cans be x, and the number of corn cans be y. We can then set up a system of equations to solve this problem.
x+y=36
0.8x+0.4y=20.8
Lets rearrange the first equation to find the value of one variable.
x=36-y
We can then substitute this value into the other equation, and solve for y.
0.8(36-y)+0.4y=20.8
28.8-0.8y+0.4y=20.8
-0.4y=-8
0.4y=8
y=20
Lastly, we can take this value and plug into the first equation to find the value of the other variable.
x+20=36
x=16
Thus, he bought 16 cans of tomatos and 20 cans of corn.