Question: In C++, annotate code, show output from IDE Complete MultiplyValues()'s base case to output the product = and inVal when inVal > inVal; MultiplyValues(inVal, 1);
In C++, annotate code, show output from IDE
Complete MultiplyValues()'s base case to output the product "=" and inVal when inVal <= 4
Ex: if the input is 12 then the output is:
384 = 4 * 8 * 12
Code below:
#include
void MultiplyValues(int inVal, int result) { result = result * inVal; /* Your code goes here */
else { MultiplyValues(inVal - 4, result); cout << " * " << inVal; } }
int main() { int inVal; cin >> inVal; MultiplyValues(inVal, 1); cout << endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
