Let us assume x and y are the two digits of the number
Therefore, two-digit number is = 10x + y and the reversed number = 10y + x
Given:
x + y = 12
y = 12 – x -----------1
Also given:
10y + x - 10x – y = 18
9y – 9x = 18
y – x = 2 -------------2
Substitute the value of y from eqn 1 in eqn 2
12 – x – x = 2
12 – 2x = 2
2x = 10
x = 5
Therefore, y = 12 – x = 12 – 5 = 7
Therefore, the two-digit number is 10x + y = (10*5) + 7 = 57