Mar 29, 2012 at 12:41am UTC
You are setting answer3 equal to num1 * num2 when neither of them have any values assigned to them at that point, so it just gives you a random number instead.
Move
int answer3 = num1 * num2;
So it is after the user enters num1 and num2.
Mar 29, 2012 at 12:44am UTC
oh so it would work if i moved that below my cin>>num1;
and cin>>num2;
?
Mar 29, 2012 at 12:45am UTC
Yep. Then the compiler would know what numbers to use.
Mar 29, 2012 at 12:46am UTC
Is this because it reads top down?
Mar 29, 2012 at 12:47am UTC
Correct, C++ reads left to right and top to bottom just like a person would. So you always need to declare/define things before you use them.