sort vector in descending order c++

#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> vec = {5, 2, 8, 1, 6};

    // Step 1: Include necessary headers for the program.

    // Step 2: Declare a vector of integers and initialize it with values.

    // Step 3: Use the sort function from the algorithm header to sort the vector in descending order.
    std::sort(vec.begin(), vec.end(), std::greater<int>());

    // Step 4: Display the sorted vector.
    std::cout << "Sorted Vector (Descending Order): ";
    for (int num : vec) {
        std::cout << num << " ";
    }

    return 0;
}