C++ program to input a word (max. length from user and print each of its characters on new line in Reverse Order
C++ program to input a word (max. length from user and print each of its characters on new line in Reverse Order)
Best answer
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word;
cout << "Enter a word: ";
cin >> word;
cout << "Reverse order of characters:" << endl;
for (int i = word.length() - 1; i >= 0; i--)
{
cout << word[i] << endl;
}
return 0;
}

Log in or create a free account to answer this question.