Reversing the name (string)

PHOTO EMBED

Fri Dec 10 2021 16:53:50 GMT+0000 (Coordinated Universal Time)

Saved by @abzal_nurgazy #c++

#include <iostream>
#include <string>
using namespace std;


int main()
{
    string userName;
    cout << "Enter the user name" << endl;
    getline(cin, userName);

    for (int ind = userName.length()-1; ind >= 0; ind--) {
        cout << userName[ind];
    }
    cout << endl;

    return 0;
}
content_copyCOPY