Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why is it wrong to change int to double when defining data type in C language?
Why is it wrong to change int to double when defining data type in C language?
You used %d(int type) in the final output. If you change it to %lf, it should be no problem to correspond to double type.

Double types and int types are stored differently in memory.

Reading double type in the way of int type will naturally have problems.