#include int main () { int i = 5; long j = 6; double d = 3.141; j = i; // Works fine. Implicit cast from int to long. d = i; // Works fine. Implicit cast from int to double i = j; // Does not compile. i = d; // Does not compile. d = 3.141; i = (int) j; // Compiles. Explicit cast from long to int. i = (int) d; // Compiles. Explicit cast from double to int. // Cast's can be used in any expression: printf ("The int part of d=%lf is %d\n", d, (int) d); }