Typical Arithmetic Conversion.
The typical arithmetic conversions are implicitly performed to cast their values to a common type.The compiler first performs integer promotion; if the operands still have different types, then they are converted to the type that appears highest in the given hierarchy.
In any program it is recommended to only perform arithmetic operations on pairs of values of the same type. When compatible types are mixed in an assignment, the value of the right side is automatically converted to the type of the left side.
For widening conversions, the numeric types, including integer and floating-point types, are compatible with each other. There are no automatic conversions from the numeric types to char or boolean. Also, char and boolean are not compatible with each other. However, an integer literal can be assigned to char
Example -
#include <stdio.h>
int main (void)
{
float f1 = 123.125, f2;
int i1, i2 = -150;
char c = 'a';
/* floating to integer conversion */
i1 = f1;
printf ("%f assigned to an int produces %i\n", f1, i1);
/* integer to floating conversion */
f1 = i2;
printf ("%i assigned to a float produces %f\n", i2, f1);
/* integer divided by integer */
f1 = i2 / 100;
printf ("%i divided by 100 produces %f\n", i2, f1);
/* integer divided by a float */
f2 = i2 / 100.0;
printf ("%i divided by 100.0 produces %f\n", i2, f2);
/* type cast operator */
f2 = (float) i2 / 100;
printf ("(float) %i divided by 100 produces %f\n", i2, f2);
return 0;
}

