Question: C++ - Using a static integer variable, sum, in a function called AddUp(), keep a running total of values passed by repeated calls to the

C++ - Using a static integer variable, sum, in a function called AddUp(), keep a running total of values passed by repeated calls to the function. After each call to the function, add the value passed in to sum and return and display sum in main().

Example: cin >> value; while(value != 0) { result = AddUp(value); cout << result; cin >> value; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!