C++ program to arrange numbers in ascending and descending order
Answers
Answered by
1
To sort elements in Descending order, we need to pass a function as third parameter, we can use greater<>() function. This function creates comparison between the elements and puts the greater (largest element) first and then we can get descending order sorted elements. Syntax: sort(first, last, camp/function);
Similar questions
Math,
6 months ago
Math,
6 months ago
Business Studies,
11 months ago
Biology,
1 year ago
Physics,
1 year ago