Question: C++ Write a recursive function to RETURN the nth term from the following SERIES { 0, 0.5, 1.5, 3, 5, 7.5 } That is, the
C++
Write a recursive function to RETURN the nth term from the following SERIES { 0, 0.5, 1.5, 3, 5, 7.5 } That is, the 0th term is 0, the 1st term is 0.5. HINT: Only the 0th term is required to handle the base case. The difference between each term depends on the previous RULE EXCEPTION: You may use multiplication operator on the recursive step for this one */ double myseries( unsigned long n );
This is what I have so far:
-------------------------------------------------------------------------------------------
double myseries( unsigned long n) //need help with
{
if (n==0)
return 0;
else
return (n + myseries(n-1);)
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
