joydeb answer is 24
let me explain...
let,present age of A and B is x and y.
before 3 yrs ago sum of their age was (x-3)+(y-3)=2*18
x+y=42..........(1) and
now sum of their age is x+y+z=22*3 (let c's present age is z)
x+y+z=66..........(2)
solving eqn (1) and (2), we get z=24