0 votes
130 views
in Programming by
edited
C++ program to input a word (max. length  from user and print each of its characters on new line in Reverse Order)

1 Answer

0 votes
by (98.9k points)
selected by
 
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;
}
image

Related questions

0 votes
1 answer 371 views
0 votes
1 answer 1.3k views
0 votes
1 answer 440 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

504 users

...