how to sort array in decreasing order by using sort function in c++ code example Example: sort in descending order c++ stl sort(arr, arr + n, greater<int>())