Array as parameter

/******************************************************************************

                          Online C++ Compiler.
           Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press “Run” button to compile and execute it.

*******************************************************************************/

#include

using namespace std;
int maxreturn(int arr[],int m)
{
int m;
int arr[m];
int sum=0;
for(int i=0;i<m;i++)
{
if(sum<arr[i])
{
sum=arr[i];
}
}
return sum;
}
int main()
{
int n;
cin>>n;
int arr1[n];
for(int i=0;i<n;i++)
{
cin>>arr1[i];
}
maxreturn(arr1,n);

return 0;

}

What is your question?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.