
Untitled
By:
dslong1 on
Jun 21st, 2012 | syntax:
None | size: 0.68 KB | hits: 8 | expires: Never
1.
//Greg's For Test
2.
3.
#include <iostream>
4.
#include <string>
5.
6.
using namespace std;
7.
8.
int main()
9.
{
10.
string word;
11.
string reverseWord;
12.
13.
cout << "Enter a word: ";
14.
cin >> word;
15.
cout << "\nYour word was " << word << ".\n\n";
16.
cout << word << " in reverse is: \n\n";
17.
18.
for (unsigned i = word.length(); i > 0; i--)
19.
{
20.
cout << word[i-1];
21.
}
22.
23.
cout << endl << endl;
24.
25.
return 0;
26.
}