Answer:
16 in first and 8 in second
Explanation:
Let the number of apples be x in the first box then the number in the second box will be 24-x
if we half the number of apples in first box we get

And we add 4 apples in the second box we get

Since the apples in the two boxes were 20 we get


After simplification we get:
x=16
Hence, number of apples in first box were x that is 16
And number of apples in second box were 24-x that is 24-16 is 8