This is because floating point representation (see IEEE 754 standard).
In short, set of bits, which makes 12.5 floating point value in IEEE 755 representation when interpreted as an integer will give you strange value which has not much in common with 12.5 value.
WRT to 0 from printf("%d\n", a) , this is internal undefined behavior for incorrect printf call.