0

Error in while loop?

https://code.sololearn.com/cI9aFIzX3LOc/?ref=app I was playing with the while loop and nums and the last number came out as a negative I don’t know if this was supposed to happen or not cause I’m very new to this.

4th Jan 2019, 11:27 PM
James Lewis
James Lewis - avatar
1 Odpowiedź
+ 4
There's a file called LIMITS.H which is a standard header that defines that the maximum positive value a "int" variable could store is "2147483647". You could ask a output for this number + 1 and see that it turns a negative number.
5th Jan 2019, 12:35 AM
Zenobio
Zenobio - avatar