We solve this using proportion, so
shadow : height : : shadow : height
48 : x : : 9.6 : 40
48/x = 9.6/40
Taking reciprocal, we get
x/48 = 40/9.6
Multiply by 48 on both sides, we get
48 * x/48 = 48 * 40/9.6
x = 1920/9.6
x = 200 feet
Hence the height of the building is 200 feet.