Program to reverse a string in C++ code example Example: Reverse string C++ reverse(str.begin(),str.end());