int main ()
int x, x1, x2, x3;
cout << "Enter first number for x: \n";
cin >> x1;
cout << "Enter second number for x: \n";
cin >> x2;
cout << "Enter third number for x: \n";
cin >> x3;
x = x1 + x2 + x3
cout << x;
I think you can cin an array and then put it into x too.
My example wasn't clear, sorry. I cin the number for variable ordered say twice. Two different numbers each time. The outfile below displays both numbers I put in for ordered (54 and 90) . I need to be able to add those numbers up.
I may be missing something here, and really the explanation isn't very clear. This seems to be a case of simply keeping a running total. Initialise totalord and others to zero, and keep adding to them as you go along.
For example, after