Question: The below code is giving me errors, any help would be appreciated. #include #include using namespace std; int arraysum(int arr[], int n) { if (n

The below code is giving me errors, any help would be appreciated.

#include #include

using namespace std;

int arraysum(int arr[], int n) { if (n<0) return 0;

else return (arr[n]+arraysum(arr, n-1));

}

int main() { int array[100], sum=0, n;

cout << "Enter the Value of N"; cin >> n;

cout << endl << "Enter the Values into the array"; for (int i=0; )

cin>> array[i];

sum=arraysum(array, n-1);

cout << "Sum of Array is:" << sum << endl;

system("PAUSE"); 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 Databases Questions!