Ohk, here's what you can do,
1) Ask what the user wants to do, (add, subtract, etc etc)
2) Ask how many numbers she wants to do it with..
3) Store the number in variable (say) 'n'
4) Now declare a temp variable (say) 'temp' and 'temp1'
5) Initialize temp to 0, and temp1 to 1.
6) Suppose the users choice is add n numbers. You run a loop like this:
1 2 3 4 5 6 7
|
for (int i=1; i<=n; i++)
{
cin>>num;
temp=temp+num;
}
cout<<"The sum of the "<<n<<" numbers is: "<<temp;
|
7)Use similar logic for all operations. Use temp1 for multiply and divide, and temp for add and subtract.
:)