The height of building is 27 feet
Solution:
Given that,
Height of gate is 3 feet
The gate casts shadow is 5 feet long
Building cast shadow is 45 feet long
Height of building = ?
Let the height of building be "n"
3 feet tall ⇒ 5 feet long shadow
"n" feet tall ⇒ 45 feet long shadow
By cross multiplication we get,

Thus height of building is 27 feet