When an expression mixes several operators, C evaluates them according to a fixed precedence and associativity table, and it silently converts between types when needed.
int result = 2 + 3 * 4; // 14, not 20 — * binds tighter than +
int result2 = (2 + 3) * 4; // 20 — parentheses always override precedence
int i = 10;
double d = i; // implicit conversion: int promoted to double, safe, no data lost
int truncated = 3.99; // implicit conversion: double to int, TRUNCATES to 3, data lost!
double explicitCast = (double)i / 3; // explicit cast avoids surprise integer division
When operators of different precedence appear together, higher-precedence operators (like * and /) bind before lower-precedence ones (like + and -) — exactly like standard math notation. When in doubt, or when precedence is genuinely ambiguous to a reader, use parentheses; they cost nothing at runtime and remove any doubt.
C performs implicit type conversion (also called "usual arithmetic conversions") automatically when mixing types — converting int to double is always safe since no information is lost, but converting double to int truncates the decimal part silently, with no warning by default. Use an explicit cast, (double)i, whenever you specifically intend a conversion — it documents your intent and helps avoid accidental integer-division bugs, as in the last example above where casting one operand to double forces the whole expression to use floating-point division.