include <iostream>
usingnamespace std;
int sumarray(int [],int);
int sumarray(int a[],int n)
{
if (n==1)return a[0];
elsereturn(a,(n-1)+sumarray(a,n-1));
}
int main()
{
int a[]={6,3,2,8,-7,4};
cout<<sumarray(a,5)<<endl;
return 0;
}
im trying to understand the else return part if someone can help
the answers in 12 by the way
ok i fix it now is coming to 16