Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What will happen if the input of C language is int, the output is %f, the input is float and the output is %d?
What will happen if the input of C language is int, the output is %f, the input is float and the output is %d?
See what kind of variables you declare.

If the declared variable is of type int, the %d format should be used for scanf input and printf output.

If the declared variable is of floating-point type, the %f format should be used for scanf input and printf output.

Otherwise, the wrong format is used and the output is garbled.

If you have any questions, please leave a message.