To construct a wall 18 m long, 0.5 m thick and 9 m high, bricks of dimensions 20 cm *15*10 cm each are used. if the mortar occupies1/10th of the volume of the wall,then find the number bricks used.

The easy way is just to divide 9/10 of the volume of the wall by the volume of a brick. So, that would be (using cm for all dimensions)

(0.9 * 1800 * 900 * 50)/(20*15*10) = 24,300

Or, since 10% of the thickness of the wall is 45cm = 3 bricks thick (with mortar), you can divide 90% of the area by the area of a brick, and multiply by 3:
3*(0.9 * 1800 * 900)/(20*10) = 21,870

Why do the two answers differ? Is either one correct?

Of course, this assumes no bricks have to be cut to fit the dimensions of the wall ...