C - Implicit Type Conversion

From EdWiki

Implicit Type Conversion

  • When an operator has operands of different types, they are converted from a narrower operand into a wider one without loosing information.
  • Implicit type conversion is done automatically by the C – compiler.


float f1, f2;
int i = 10;
f1 = f2 = 20.713489;
f1 = f2 + i; 
// i is converted to float before the addition takes place.