/* Program 8.2.1 from C++ Programming Lecture notes  */

/* Author: Rob Miller and William Knottenbelt
   Program last changed: 30th September 2001    */

/* This program inputs a series of characters from the keyboard, 
terminating with a '.', and then prints out the characters
backwards on the screen. */ 

#include<iostream>
using namespace std;

/* Function to input a series of characters from the keyboard
and then print them backwards on the screen. */
void print_backwards();

/* START OF MAIN PROGRAM */
int main()
{
	print_backwards();
	cout << endl;
	
	return 0;
}
/* END OF MAIN PROGRAM */

/* START OF DEFINITION OF FUNCTION print_backwards */
void print_backwards()
{
	char character;
	
	cout << "Enter a character ('.' to end program): ";
	cin >> character;
	if (character != '.')
	{
		print_backwards();
		cout << character;
	}
	else
	{
		;
	}
}
/* END OF FUNCTION DEFINITION */
