#include<iostream.h>
#include<conio.h>
struct Book
{
char code;
int pages;
float price;
void show()
{
Book b[3];
cout<<sizeof(b)<<endl;
int i;
for(i=0;i<3;i++)
{
cout<<"Enter book code, pages and price\n";
cin>>b[i].code>>b[i].pages>>b[i].price;
}
for(i=0;i<3;i++)
cout<<"Code="<<b[i].code<<" Pages="<<b[i].pages<<" Price="<<b[i].price<<endl;
}
};
int main()
{
clrscr();
Book b;
b.show();
getch();
return 0;
}
No comments:
Post a Comment