Question: Complete SumSequence()'s recursive case to return the sum of the following: val. the sum of the series from val - 3 down to 3. Ex:
Complete SumSequence()'s recursive case to return the sum of the following:
- val.
- the sum of the series from val - 3 down to 3.
Ex: If the input is 11, then the output is:
26
#include
int SumSequence(int val) { if (val <= 3) { return val; } /* Your code goes here */
}
int main() { int val; cin >> val; cout << SumSequence(val); 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
