Why doesn't the code
int a = 1000, b = 1000; long int c = a * b;
work? plz help me sir .
In your code there is a problem of either overflowing or truncation. The promoted value is not being assigned to long int in LHS. Here you will have to cast explicitly at least one or both of the operands into long int. You can try either of them :
long int c = (long int)a * b; Or, long int c = (long int)a * (long int)b;