

Let the digit in the number is xy.
So number is 10x + y
Given
sum of the digits of a two-digit number is 12
=> x + y = 12..........................1
Again
10y + x = 10x+ y + 54
=> 10y + x - 10x - y = 54
=> 9y -9x = 54
=> y - x = 6 ..................2
Add equation 1 and 2, we get
2y = 12 + 6
=> 2y = 18
=> y = 18/2
=> y = 9
From equation 1,
x + 9 = 12
=> x = 12 - 9
=> x = 3
So, the required number is 39
