max function for vector code example Example: max of a vector c++ cout<<*max_element(a.begin(), a.end())<<endl;