stl sort in decreasing order in cpp code example Example: sort in descending order c++ stl sort(arr, arr + n, greater<int>())