When using a decimal constant without any suffixes, the type of the decimal constant is the first that can be represented, in order (current standard C, 6.4.4 Constants p5):
The type of the first expression is int , since each constant with values โโof 1024 and 2 can be represented as int. The calculation of these constants will be performed in the int type, and the result will overflow.
Assuming that INT_MAX is 2147483647 and LONG_MAX is greater than 2147483647, the type of the second expression is long int , since this value cannot be represented as int, but it can be the same long int. If INT_MAX is LONG_MAX is 2147483647, then the type is long long int .
2501
source share