[ACCEPTED]-integer constant is too large for "long" type-dev-c++

Accepted answer
Score: 31

Try an "ULL" suffix: 600851475143ULL


Score: 4

Your literal as typed has type int which isn't 5 big enough to hold the value. Try 600851475143ULL as a 4 first fix.

Note even with that, your for loop 3 will never terminate since an unsigned can 2 never be less than 0. Instead, use a long long and 1 600851475143LL.

Score: 0

Must be a limitation of dev-c++ support 1 for long long datatype. It compiles fine on MS VC++ 2010.

More Related questions