I am coding a C++ program to calculate a math problem. I first write:
int x = 1
int y = 1
int z = 1
int answer = x * y * z
cout << answer << endl;
And when I build and run that, it prints 1. But when I do this:
int x = 1234;
int y = 5243;
int z = 1142;
int answer = x * y * z;
cout << answer << endl ;
It prints out instead a answer, which is 7388502404, but a code I don't understand: "-1201352188". Could you explain why does this code happens, and how to solve the code?