Hi everybody,
I have a crazy problem with a basic calculator.
#include <iostream>
using namespace std;
main (){
int num;
int y;
int ans;
cin >> num;
for (int x = 0;x < num;++x){
cin >> y;
ans += y;
cout << ans << endl;
}
}
it take the quantity from the user and then adds this quantity of numbers and each time prints the answer, but when i add the first number, i get an error by 54, why???????????
Sorry if im not clear and thanks.