//
// Example1
// Program to accept details of books
// and store details in an array.
// Prints details of books to the
screen.
#include <iostream>
const int MAX_ELEMENTS = 200;
int main()
{
// declare three character arrays to hold the title, author and publisher respectively.
char title[MAX_ELEMENTS];
char author[MAX_ELEMENTS];
char publisher[MAX_ELEMENTS];
// The following code will accept input
until white space is read.
// Any text following white space
will be read by the following cin.
// See Example2 using getline() to
read in a string.
// Request Input of title details.
cout << "Enter title: press
return when finished"<<endl;
cin >>title;
// Request Input of author details.
cout << "Enter author: press
return when finished"<<endl;
cin >>author;
// Request Input of publisher details.
cout << "Enter publisher: press
return when finished"<<endl;
cin >>publisher;
// Output of title details.
cout<<title<<endl;
// Output of author details.
cout<<author<<endl;
// Output of publisher details.
cout<<publisher<<endl;
}