In C++ can you go from a larger type to a smaller type. Example

long lg;
int in;

lg = 89;
in = lg;

Is this legal or will the compiler give an error????