#include<stdio.h>
struct book{
       char name[12];
       float price;
       int pages;
       };
main()
{
   int i,n;   
   struct book *q;
   printf("Enter Number of books : ");
   scanf("%d", &n);
   printf("Size = %d\n", sizeof(struct book));
   q = (struct book*)malloc(sizeof(struct book)*n);
   
   for(i=0; i<n; i++)
   {
      fflush(stdin);      
      printf("\nEnter record of book no. %d\n", i+1);
      printf("Name : ");
      gets((q+i)->name);
      printf("Price : ");
      scanf("%f", &(q+i)->price ); 
      printf("Pages : ");
      scanf("%d", &(q+i)->pages );        
   } 
   
   for(i=0; i<n; i++)
   {
      printf("\n------\nRecord of book no. %d\n", i+1 );
      printf("Name : %s , address:%d\n", (q+i)->name, (q+i)->name );
      printf("Price : %0.2f , address:%d\n", (q+i)->price, &(q+i)->price ); 
      printf("Pages : %d , address:%d\n", (q+i)->pages, &(q+i)->pages ); 
   }
   free(q);
   system("pause");
}
   
   
