Array max value

#include
#include
using namespace std;
void maxValue(int arr[], int n){
int maxNumber = INT_MIN;
for(int i = 0; i < n; i++){
if(arr[i] > maxNumber){
maxNumber = arr[i];
}
}
cout << “Max value in array” << maxNumber << endl;
}

int main() {
int n;
cin >> n;

int arr[n];

for(int i = 0; i < n; i++){
	cin >> arr[i];
}

maxValue(arr, n);

return 0;

}

Can you please tell what is wrong with above code, as i am not able to submit the answer.

hi @singhkastha_57541d9f3a037bff i can see you have submitted with 100 points still having any doubts buddy?

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.