Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

What are the possible tax implications of fraud against a business?

Answered: 1 week ago

Question

=+1.3(b), show that a trifling set is nowhere dense [A15].

Answered: 1 week ago

Question

here) and other areas you consider relevant.

Answered: 1 week ago