how to sort array in c++

#include <iostream>
#include <algorithm>

int main() {
    const int size = 5;
    int arr[size] = {3, 1, 4, 1, 5};

    // Step 1: Include necessary headers for array manipulation
    // #include <iostream> for input and output operations
    // #include <algorithm> for the sort function

    // Step 2: Declare an array and initialize it with values

    // Step 3: Use the std::sort function to sort the array
    std::sort(arr, arr + size);

    // Step 4: Display the sorted array
    std::cout << "Sorted array: ";
    for (int i = 0; i < size; ++i) {
        std::cout << arr[i] << " ";
    }

    return 0;
}