#include <iostream>
#include <string>
usingnamespace std;
struct book {
string title[100];
int pages;
float price;
};
int main()
{
int i;
book b[3],*ptr;
ptr=b;
for(i=0;i<3;i++)
{
cout<<"Enter the book's name for "<<i+1<<": ";
getline(cin,ptr->title[i]);
cout<<"Enter the Price of the book: ";
cin>>ptr->price;
cout<<"Enter the number of pages in the book: ";
cin>>ptr->pages;
ptr++;
}
ptr=b;
for(i=0;i<3;i++)
{
cout<<"The "<<i+1<<"- book's name : "<<ptr->title<<endl;
cout<<"The Price of the book: "<<ptr->price<<endl;
cout<<"The number of pages in the book: "<<ptr->pages<<endl;
ptr++;
cout<<"-------------------------------------------"<<endl;
}
}