C++ Program to Demonstrate the rotate() Algorithm

This C++ program demonstrates the rotate() algorithm. The function rotate() takes three iterators as parameters – first iterator to the beginning of container, second iterator to element by which the elements are rotated and the third iterator to the end of the set of elements to be rotated. The program demonstrates the use of the algorithm which modifies the order of the container whose order is being rotated.

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

/*

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