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 using namespace std;

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

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 Programming Questions!