Mega Code Archive

 
Categories / C++ Tutorial / STL Algorithms Min Max
 

Min

#include <iostream> using std::cout; using std::endl; #include <algorithm> int main() {    cout << "\nThe minimum of 'G' and 'Z' is: " << std::min( 'G', 'Z' );    cout << "\nThe minimum of 12 and 7 is: " << std::min( 12, 7 );    cout << endl;     return 0; } The minimum of 'G' and 'Z' is: G The minimum of 12 and 7 is: 7