Whatever the building's height happens to be (we'll call it h), we can say that the ratio of its height to its shadow will be the same as the flagpole's height to its shadow. Mathematically, we'd write the ratio of the building' height to its shadow as the fraction
, and the ratio of the flagpole to its shadow
. Since these are the same value, we can set up the equation

The two fractions are equivalent, which means there is number we can multiply 48 by to get us 9.6, and multiplying h by that same number will get us 40.
Since we're in the world of equivalent fractions, making another one won't cause any harm. If we multiply the numerator and denominator of
by 10, it becomes

and now our situation is like this:

We multiply 48 by 2 to get 96, which means that multiplying h by 2 gets us 400. What number multiplied by 2 is 400? That'd simply be 200 (200 x 2 = 400), so the building is 200 feet high.