+ 2
Intergers have limits you need a different data type if you have enough digits. https://www.tutorialspoint.com/cplusplus/cpp_data_types.htm
13th Aug 2017, 11:13 PM
Manual
Manual - avatar
+ 5
Without code, might be an overflow if it always displays the same random number with the same large insert. Got a CodePlayground link?
13th Aug 2017, 10:47 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
@Manual...I've been sitting with this in my clipboard because I'm having some trouble with both of yours's code: ============== Integers are 4 bytes on this platform. 4 bytes = 32 bits = 2^32 = 4294967296. You're using signed integers, so divide that in half: 2,147,483,648..... trails off to try code.... ================== When I enter 10000000000, as in the question statement (and regardless of any other values, even incomplete input), the min/max ceilings to integer (not long) max and all the other cins appear to be nonfunctional. Just FYI.
13th Aug 2017, 11:26 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
Yep, that's what I was fiddling with: int i; long l; unsigned long long ull; cout << sizeof those 4, 4, 8 Anyway, learned something .... longs and ints not different here. Thanks @Manual.
13th Aug 2017, 11:35 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
Christos 10000000000 is too large to be an interger use a template or decimal instead of int.
13th Aug 2017, 11:06 PM
Manual
Manual - avatar
+ 3
@Kirk You're welcome!
13th Aug 2017, 11:36 PM
Manual
Manual - avatar
13th Aug 2017, 11:04 PM
Manual
Manual - avatar
+ 2
13th Aug 2017, 11:11 PM
Manual
Manual - avatar
+ 2
@Christos Please do not forget to give the checkmark, to the one who helped you.
13th Aug 2017, 11:14 PM
Manual
Manual - avatar
+ 2
Try the update long long - bigger range
13th Aug 2017, 11:32 PM
Manual
Manual - avatar
+ 1
share your code [ +insert ] -add code | | \/
13th Aug 2017, 11:02 PM
Manual
Manual - avatar
+ 1
You're welcome!😸
13th Aug 2017, 11:16 PM
Manual
Manual - avatar
+ 1
did you try the new version? edit I tried it seems like the limit was reached...
13th Aug 2017, 11:28 PM
Manual
Manual - avatar