#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.