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
Political Science,
7 months ago
Social Sciences,
7 months ago
Hindi,
7 months ago
Business Studies,
1 year ago
Biology,
1 year ago
Physics,
1 year ago