Chapter 6: Problem 13
Consider the following function: int secret(int m, int n) { int temp = 0; for (int i = 1; i < abs(n); i++) temp = temp + i * m; return temp; } a. What is the output of the following C++ statements? i. cout << secret(3, 6) << endl; ii. cout << secret(5, -4) << endl; b. What does the function secret do?
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.