Answer to Question #38174 in C++ for ephrem moges

Question #38174
write a C++ program that accepts a word from the user and then displays the word after reversing it.
1
Expert's answer
2017-03-27T09:40:26-0400
#include <iostream> 
#include <conio.h>
#include <string>

using namespace std;

int main()
{
string word;
cout<<"Enter the word you'd like to reverse : ";
getline (cin , word);

cout<<"Here is the reversed word : ";
for (int i = word.size(); i >= 0; i--)
cout<<word[i];

_getch();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS