int main(){
int a = 600851475143;
int b = 1;
int remain = 1;
int TheBig = 0;
while (b < 600851475143){
remain = a% b;
if (remain == 0){
TheBig = b;
}
b++;
}
cout <<TheBig;
return 0;
}
My code above got the error type of : overflow in implicit constant conversion. I tried this algorithm in python, but it sent no output. Can you help me with this type of code?
Integer could only handle up to 2.1 billion positive numbers. You have assigned the value 600billion of an int data type that can handle again around 2.1billion thus the implicit overflow error.