Question: In C++ Write a function named isum that takes two arguments - an int array named x, followed by an int named n - and

In C++ Write a function named isum that takes two arguments - an int array named x, followed by an int named n - and returns an int value that is the sum of the first n elements in x. Example function prototype here:

int isum(int x[], int n); 

also Write another function named avg that takes two arguments - an int array named x, followed by an int named n - and returns a double value equal to the average (arithmetic mean) of the first n elements in x. Example function prototype here:

double avg(int x[], int n); 

Must be able to be put within this program skeleton:In C++ Write a function named isum that takes two arguments -

Sample output:an int array named x, followed by an int named n -

#include using namespace std; // prototypes of functions to be pasted below main int isum(int x[], int n); double avg(int x[], int n); int main) i const int MAXN 100; int a[MAXN], input; double average, diff; // fill array with data from user, and count items cout > input; while cin.good() && n > input; SET average TO AVERAGE VALUE OF FIRST n ELEMENTS OF a */ /* print summary results and header for diffs */ cout

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