+ 1
C++ ERROR. The problem is in the code. Please help. Thanks in advance!
2 Answers
+ 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;
+ 1
ChaoticDawg thank you, it works now!