how to sort in descending order c++
int arr[10];
int length = sizeof(arr)/sizeof(arr[0]);
sort(arr, arr+length, greater<int>());
how to sort in descending order c++
int arr[10];
int length = sizeof(arr)/sizeof(arr[0]);
sort(arr, arr+length, greater<int>());
sort in descending order c++ stl
sort(arr, arr + n, greater<int>())
sort function descending c++
// 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 : \n";
for (int i = 0; i < n; ++i)
cout << arr[i] << " ";
return 0;
}
how to sort in descending order in c++
sort(str.begin(), str.end(), greater<int>());
cout<<str;
descending order c++
sort(begin(arr), end(arr), greater<>())
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us