how to find maximum and minimum value in a vector C++ code example Example: maximum in vector *max_element(a.begin(), a.end());