using namespace std;
int A[]={1,3,4};
int max(int A[], int n){
if(n==1) return A[0];
int res = max(A,n-1);
if(res>A[n-1]) return res;
else return A[n-1];
}
int main(){
cout<<max(A,3);
}
the code works but what i dont understand is how res can take another value except A[0]. Everytime i trace it i can not understand how max(A,n-1) can have a result except when n=1