#include <iostream>
#include <vector>

using namespace std;

int main() {
    vector<int> arr = {1, 2, 3, 4, 5};

    // A normal for loop using reverse iterators
    // auto automatically deduces the type: vector<int>::reverse_iterator
    
    for (auto it = arr.rbegin(); it != arr.rend(); ++it) {
         cout << *it << " ";
        // Dereference the iterator to get the value
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: