According to the meaning, m must be of type int, long or char; N can be of any basic type, such as int, float and double.
Because the variable m is on the left of the equal sign, its type is an integer, so no matter what the budget result on the right of the equal sign is, it must be converted into an integer before it can be assigned to the variable m.
But you will say that the operation result on the right side of the equal sign is also an integer, and no conversion is needed.
Let's look at the right side of the equal sign. Yes, we found the number "0.5", which is an even number. Why do I say "0.5" is a double precision type, not a floating point type? You can run it:
sizeof(0.5),sizeof(float),sizeof(doule),
You will find that the results are 8, 4 and 8 respectively, which means that the value of 0.5 is stored in 8 bytes like a double.
In C language, regardless of the number of operations, the type of the result must be the largest of these numbers. The size of the type is: char
That is, from the char type with the smallest range to the double type with the largest range.
So the expression n* 100+0.5 on the right side of the equal sign, because 0.5 is a double type (the largest type), and the final operation result must be a double type!
The left side is an integer, and the right side is a double type, so the right side has to be forcibly converted to an integer, that is, the automatic conversion from a real number type to an integer has taken place.