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;
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.