+ 1

C++ ERROR. The problem is in the code. Please help. Thanks in advance!

https://code.sololearn.com/cA1A1a183A12/?ref=app

10th Feb 2021, 5:47 AM
JT JT
JT JT - avatar
2 Respuestas
+ 4
This is because the resulting value is greater than what a variable of type signed int can hold. If all you need are positive numbers try making it unsigned then since you need a larger number size use a type that can hold it, such as long or long long. unsigned long long int y = 1;
10th Feb 2021, 5:56 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
ChaoticDawg thank you, it works now!
10th Feb 2021, 1:47 PM
JT JT
JT JT - avatar