#include #include using namespace std; int main() { const string str = "Hello world"; string revStr = ""; for (unsigned int i = 0; i <= str.length(); i++) revStr += str[str.length()-i]; cout << "the reversed string is : " << revStr << endl; }