C++ Program to Demonstrate the reverse_copy() Algorithm

This C++ program demonstrates the reverse_copy() algorithm. The function reverse_copy() takes three iterators as parameters – two iterators to the beginning and the end of the container elements to be reversed and the third iterator to the container where reversed elements are to be saved. The program demonstrates the use of the algorithm which doesn’t modify the order of the container whose order is being reversed.

Here is the source code of the C++ program which demonstrates the reverse_copy() algorithm. The C++ program is successfully compiled and run on a Linux system. The program output is also shown below.

/*

* C++ Program to reverse the order of elements using reverse_copy() algorithm