Explanation:
there is a right-angled triangle.
its legs (enclosing the 90° angle) are the height of the skyscraper (396 m) and the shadow (332 m).
so, we know the third side (the Hypotenuse, which is the line of sight between the end of the shadow and the top of the skyscraper) too by using Pythagoras :
c² = a² + b²
line² = 396² + 332² = 156816 + 110224 = 267040
line = sqrt(267040) = 516.7591315... m
and we know 1 angle : the 90° angle between the legs.
the other angles we can now get by using the law of the sines :
a/sin(A) = b/sin(B) = c/sin(C)
where the angles are opposite of the lines.
the line of sight is opposite of the 90° angle.
and the height of the skyscraper is opposite of the angle between the line of sight and the shadow. this angle is also the angle of the sun above the horizon, as the extended line of sight would lead directly to the sun.
so, we have
516.7591315.../sin(90) = 396/sin(angle)
as sin(90) = 1
516.7591315... = 396/sin(angle)
sin(angle) = 396 / 516.7591315... = 0.76631447...
angle = 50.02407526...°