program statements and expressions should typically use only one type of variable and constant, but if you use a mixed type,
C uses a collection of rules to accomplish automatic conversion of data types.
Here are some basic rules for C data type conversions :
1. When appearing in an expression, both signed and unsigned char and short types are automatically converted to int.
2. In any operation that contains two data types, the lower-level type is converted to another higher-level data type in the operation.
3. The data type level is from high to low in the order of long double, double, float, usigned long long, long long unsigned long, long, unsigned int, One possible exception to int is that when long and int have the same size, the unsigned int level is higher than long,short and Char is promoted to int by rule 1.
4. In an assignment statement, the result of the calculation is converted to the type of the variable to be assigned, which can result in a level increase (the type level of the assigned value is high) or degraded (the type level of the assigned value is low), and the promotion is usually a smooth, lossless process, but the demotion can lead to a real problem.
5. When a parameter is passed as a function, char and short are converted to int,float to double, but the automatic promotion can be prevented by specifying the function prototype.
Reference: C Primer Plus
Basic rules for C-language data type conversion