Question: In C++ write a program to compute the following summation (n is input from the user) 1/n + 2/(n-1) + 3/(n-2) +...+n/1 Write the function
In C++ write a program to compute the following summation (n is input from the user)
1/n + 2/(n-1) + 3/(n-2) +...+n/1
Write the function that takes in an array of integers (1 to n) and returms the sum of the series.
Use header double sum ( int nums[], int size)
Also write how the function wpuld be called in your main function.
In main function, prompt the user for number n, then store the integers 1 through n in an array, call the sum function to get the sum of the series and output the result.
sample output
Enter n to compute the summation 30
The sum of the series is 93.84
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
