-
What is the output of this program?
#include <iostream>
#include <algorithm>
using namespace std;
bool Function(int k, int L)
{
return k < L;
}
int main ()
{
int Array[ ] = {31, 17, 12, 51, 16, 14};
cout << *min_element(Array, Array + 6, Function) << " ";
cout << *max_element(Array, Array + 6, Function) ;
return 0;
}
-
- 17 31
- 31 17
- 51 21
- 12 51
- Compilation Error
Correct Option: D
In this program, We found out the minimum value and maximum value of a range.