I'm not sure whether you're asking Why did it not print 11? or Why did it print different answers under different compilers?.
The reason it didn't print 11 is that, as other answers have explained, %d doesn't print floats, and in printf calls there are no automatic conversions to fix up mismatches between passed and expected types.
And the reason it printed different things under different compilers is that it's undefined behavior, meaning anything can happen. Suppose you go out to your car, loosen all the lugnuts on the front wheel until it's about to fall off, get in, and drive down the road at high speed until the wheel does fall off, whereupon you lose control and crash into a ditch. And suppose you get a new car and do exactly the same thing tomorrow, except that by chance you crash into a tree instead. At this point there are two approaches you could take:
- Try to figure out what subtle factors caused you to crash into a ditch on one day, and a tree on another day. Why wasn't it more repeatable?
- Resolve not to try foolish experiments like this again.