The problem can be drawn as a right triangle (image attached) and we can use ratio of tan to determine the height of the building
tan of the angle = side in front of the angle / side adjacent to the angle
tan 48° = height of building / horizontal distance
plug the numbers into the equation above
height of building / horizontal distance = tan 48°
h/45 = tan 48°
h = tan 48° × 45
h = 1.1106 × 45
h = 49.98 feet