Question: int findMaxValue ( int n ) { std::vector arr ( n ) ; int max = INT _ MIN; for ( int i = 0

int findMaxValue(int n){
std::vector arr(n);
int max = INT_MIN;
for (int i =0; i < n; ++i){
std::cin >> arr[i];
if (arr[i]> max){
max = arr[i];
}
}
return max;
}
int main(){
int n;
std::cin >> n;
int result = findMaxValue(n);
std::cout << result << std::endl;
return 0;
} convert into cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!