public :
void getdata();
void display();
};
void lib::getdata()
{
cout<<"Book no: ";
cin>>bookno;
cout<<"Enter book name:";
cin>>bname;
cout<<"Enter author name: ";cin>>auname;
cout<<"Enter book price: ";cin>>bprice;
}
void lib::display()
{
cout<<"Book no: "<<bookno<<endl;
cout<<"book name: "<<bname<<endl;
cout<<"Author name: "<<auname<<endl;
cout<<"Book price: "<<bprice<<endl;
}
int main()
{
class lib obj[100];
int i, n;
clrscr();
cout<<"How many records to enter : ";cin>>n;
cout<<endl<<"Enter the records " <<endl;
for(i=0; i<=n-1; i++)
{
cout<<"Records no: "<<i+1<<endl;
obj[i].getdata();
}
cout<<endl<<"The entered records are " <<endl;
for(i=0;i<=n-1; i++)
{
cout<<"Records no:"<<i+1<<endl;
obj[i].display();
}
getch();
return 0;
}