Let H be the height of the flagpole and B the height of the building
And we have that
tan (28) = B / 100 → 100 tan (28) = B (1)
tan (39.75) = ( B + H) / 100 → 100 tan (39.75) = B + H (2)
Sub (1) into (2)
100 tan (39.75) = 100 tan (28) + H rearrange
100 tan (39.75) - 100 tan (28) = H
100 (tan (39.75) - tan (28) ) = H ≈ 30 ft
