With a C program to read the text book number, title, author and publisher into a structure and print these values.
# include
# include
void main()
{
struct book
{
int number; char title[20]; char author[20];
char publisher[20];
};
struct book text;
clrscr();
printf("\nEnter details about the text book");
printf("\n
printf("\nEnter Book Number :");
scanf("%d",&text.number);
");
printf("\nEnter Book Title :");
scanf("%s",&text.title);
printf("\nEnter Name of the author :");
scanf("%s",&text.author);
printf("\nEnter Name of the publisher :");
scanf("%s",&text.publisher);
printf("\n\n\nDetails about the Book");
printf("\n");
printf("\nBook Number = %d",text.number); printf("\nBook Title = %s",text.title);
printf("\nAuthor = %s",text.author); printf("\nPublisher = %s",text.publisher); getch(); }