Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between d and f in the output statement of C language?
What's the difference between d and f in the output statement of C language?
The storage mode of floating-point type is as follows

This is different from the storage method of integers, so the format string %d will definitely be different, but the result is related to the compiler. There should be no problem in outputting with the format string %f, which should be 3.234000; If you simply want to change 3.234 to int type 3, you can use forced type conversion, floatnum = 3.12; int convert =(int)num;

The result is convert =3.