int main(){
int arr[5] = {1,3,2,4,5};
sort(arr, arr+5, greater<int>());
// arr == {5,4,3,2,1}
return 0;
}
int arr[10];
int length = sizeof(arr)/sizeof(arr[0]);
sort(arr, arr+length, greater<int>());
sort(arr, arr + n, greater<int>())
// C++ program to demonstrate descending order sort using
// greater<>().
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = { 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
int n = sizeof(arr) / sizeof(arr[0]);
sort(arr, arr + n, greater<int>());
cout << "Array after sorting :
";
for (int i = 0; i < n; ++i)
cout << arr[i] << " ";
return 0;
}
sort(arr, arr + n, greater<int>());
sort(str.begin(), str.end(), greater<int>());
cout<<str;
sort(begin(arr), end(arr), greater<>())