Jewel
0
Q:

*min_element in c++

#include <algorithm>    // std::min
std::min(1,2);
1
// C++ program to demonstrate the use of std::min_element 
#include <iostream> 
#include <algorithm> 
using namespace std; 
int main() 
{ 
    int v[] = { 9, 4, 7, 2, 5, 10, 11, 12, 1, 3, 6 }; 
  
    // Finding the minimum value between the third and the 
    // fifth element 
  
    int* i1; 
    i1 = std::min_element(v + 2, v + 5); 
  
    cout << *i1 << "\n"; 
    return 0; 
} 
1

New to Communities?

Join the community