// forstr2.cpp -- reversing an array
#include <iostream>
#include <cstring>
using namespace std;
const int ArSize = 20;
int main()
{
    cout << "Enter a word: ";
    char word[ArSize];
    cin >> word;

    // physically modify array
    char temp;
    int i, j;
    for (j = 0, i = strlen(word) - 1; j < i; i--, j++)
    {                       // start block
        temp = word[i];
        word[i] = word[j];
        word[j] = temp;
    }                       // end block
    cout << word << "\n";
    return 0;
}

