sort decreasing c++ vector code example Example: sort vector in descending order sort(a.begin(), a.end(), greater<int>());