Consider the following C++ function:
int mystery(int num)
{
int y = 1;
if (num == 0)
return 1;
else if (num < 0)
return -1;
else
for (int count = 1; count < num; count++)
y = y * (num - count);
return y;
}
What is the output of the following statements?
a. cout << mystery(6) << endl;
b. cout << mystery(0) << endl;
c. cout << mystery(-5) << endl;
d. cout << mystery(10) << endl;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.