Okay, you need to follow along on paper with this one. Grab some paper and a pencil. I'll wait...
...Okay, ready? Great. first, draw a right triangle. The vertical side represents the height of the taller building compared to the smaller building (we'll deal with their actual heights later). The horizontal side (the base) is the 18m. Finally, the lower right angle is 41°. Relative to this angle, the two sides we know are the opposite and the adjacent. Put them together and you get the tangent function:
Tan (θ) = Opp / Adj
Plug in everything we know:
Tan (41°) = 18 / X
.869 = 18 / X
Put the left side over 1...
.869 / 1 = 18/ X
...and you can now cross-multiply:
.869X = 18
Now solve:
.869X / .869 = 18 / .869
X = 20.707 This tells us the taller building exceeds the shorter building by 20.707m
Remember that the smaller building was already 10M high. That means you total:
20.707 + 10 = 30.707m ≈ 31m to the nearest meter