To solve this question first we have to calculate the cost price of both the cars.
Let the cost price of the care to dealer be X
1st Car X + .25X = 20,000 i.e X = 16000
Now X is cost price we have to calculate the amount he earned when he sold it which is 25% of cost price that is 25% of 16000 = 4000
2nd Car X - .20X = 20,000 i.e X = 25000.
He sold it at 20% loss which is 20% of 25000 = 5000
both the transactions combined he had loss of 1000