26. Display name of book,pages and price using pointer to structure.


Comments

  1. /* accept the information of book using pointer */

    #include
    void main()
    {

    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;

    struct book *p;

    printf("Enter NAME of book...");
    scanf("%s",p->name);

    printf("Enter Price of book...");
    scanf("%f",&p->price);

    printf("Enter Pages of book...");
    scanf("%d",&p->pages);

    printf("\nBook name=%s \nBook Price=%f \n Book Pages=%d\n",p->name,p->price,p->pages);
    }

    ReplyDelete
  2. /* accept the information of book using pointer */

    #include
    void main()
    {

    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;

    struct book *p;

    printf("Enter NAME of book...");
    scanf("%s",p->name);

    printf("Enter Price of book...");
    scanf("%f",&p->price);

    printf("Enter Pages of book...");
    scanf("%d",&p->pages);

    printf("\nBook name=%s \nBook Price=%f \n Book Pages=%d\n",p->name,p->price,p->pages);
    }

    ReplyDelete
  3. #include
    void main()
    {
    int i;
    struct Book
    {
    char name[2];

    float price;
    int pages;
    }b[2];
    struct Book *ptr;
    printf("\nEnter the Name, Price,Pages of book \n");
    scanf("%s%f%d",b->name,&b->price,&b->pages);

    printf("\nName=%s\nPrice=%f\nPages=%d\n",b->name,b->price,b->pages);

    }

    ReplyDelete
  4. yogesh1:19 PM

    /* accept the information of book using pointer */

    #include
    void main()
    {

    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;

    struct book *p;

    printf("Enter NAME of book...");
    scanf("%s",p->name);

    printf("Enter Price of book...");
    scanf("%f",&p->price);

    printf("Enter Pages of book...");
    scanf("%d",&p->pages);

    printf("\nBook name=%s \nBook Price=%f \n Book Pages=%d\n",p->name,p->price,p->pages);
    }

    ReplyDelete
  5. lengarepooja3:54 PM

    #include
    void main()
    {
    struct book
    {
    char name[50];
    float price;
    int page;
    }b;

    struct book *p;
    p=&b;
    printf("\nEnter a name of book:\n");
    scanf("%s",p->name);
    printf("\nEnter a price of book:\n");
    scanf("%f",&p->price);
    printf("\nEnter a pages of book:\n");
    scanf("%d",&p->page);

    printf("\nName of book=%s\nPrice of book=%f\nPages of book=%d",p->name,p->price,p->page);

    }

    ReplyDelete
  6. Pallavi Bagal4:13 PM

    #include
    void main()
    {
    struct Book
    {
    char name[10];
    float price;
    int pages;
    }b;
    struct Book *ptr
    printf("\n\tEnter Name of Book\n\t");
    scanf("%s",b->name);
    printf("\n\tEnter price of Book\n\t");
    scanf("%f",&b->price);
    printf("\n\tEnter Pages of Book\n\t");
    scanf("%d",&b->pages);

    printf("Book Name=%s,Book Price=%f,Book pages=%d",b->name,b->price,b->pages);

    }

    ReplyDelete
  7. Pallavi Bagal4:32 PM

    #include
    void main()
    {
    struct book
    {
    char name[50];
    float price;
    int page;
    }b;

    struct book *p;
    p=&b;
    printf("\nEnter a name of book:\n");
    scanf("%s",p->name);
    printf("\nEnter a price of book:\n");
    scanf("%f",&p->price);
    printf("\nEnter a pages of book:\n");
    scanf("%d",&p->page);

    printf("\nName of book=%s\nPrice of book=%f\nPages of book=%d",p->name,p->price,p->page);

    }

    ReplyDelete
  8. sanjivani atakare4:54 PM

    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;

    }b;
    struct book *p;
    p=&b;
    printf("\n\tEnter the book name");
    scanf("%s",p->name);
    printf("\n\tEnter the price name");
    scanf("%f",&p->price);
    printf("\n\tEnter the pages name");
    scanf("%d",&p->pages);

    printf("\n\tBook name=%s,Book price=%f,Book pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  9. #include
    void main()
    {
    struct Book
    {
    char name[20];
    float price;
    int pages;
    }b;
    struct Book *ptr;
    ptr=&b;
    printf("\nEnter the name ,price,pages of book\n");
    scanf("%s%f%d",ptr->name,&ptr->price,&ptr->pages);
    printf("\nName=%s \nPricse=%f \nPages=%d\n",ptr->name,ptr->price,ptr->pages);
    }

    ReplyDelete
  10. Waghmare Swati11:34 AM

    /*To Display the name of book,pages and price using pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price ;
    int pages;
    }b;
    struct book *p;
    p=&b;
    printf("\n\t Enter name of Book");
    scanf("%s",p->name);
    printf("\n\tEnter price of Book");
    scanf("%f",&p->price);
    printf("\n\tEnter pages of Book");
    scanf("%d",&p->pages);
    printf("\n\tBook name=%s \n\tBook price=%f \n\tBook pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  11. Mubin Pirjade11:50 AM

    only here lies a correct propgram!!Check it out!!
    #include
    void main()
    {
    struct book
    {
    int pg;
    int price;
    char name[20];
    };
    struct book *ptr,p;
    ptr=&p; //referencing pointer to memory address

    printf("\n\tEnter the pages:");
    scanf("%d",&ptr->pg);
    //fflush(0);
    printf("\n\tEnter the price:");
    scanf("%d",&ptr->price);
    //fflush(0);
    printf("\n\tEnter name of book:");
    scanf("%s",&ptr->name);
    printf("\n\tBook details are:\n\t1.Name:%s \n\t2.Number of pages:%d \n\t3.price of book:%d ",ptr->name,ptr->pg,ptr->price);
    }

    ReplyDelete
  12. Sayali Daunde12:28 PM

    /*To Display the name of book,pages and price using pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price ;
    int pages;
    }b;
    struct book *p;
    p=&b;
    printf("\n\t Enter name of Book");
    scanf("%s",p->name);
    printf("\n\tEnter price of Book");
    scanf("%f",&p->price);
    printf("\n\tEnter pages of Book");
    scanf("%d",&p->pages);
    printf("\n\tBook name=%s \n\tBook price=%f \n\tBook pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  13. #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }p;
    struct book *b;
    b=&p;
    printf("\nBook name=");
    scanf("%s",b->name);
    printf("\nPrice=");
    scanf("%f",&b->price);
    printf("\nenter no of pages=");
    scanf("%d",&b->pages);
    printf("name of book=%s\tprice=%f\tpages=%d\n",b->name,b->price,b->pages);
    }

    ReplyDelete
  14. Pandhare Dipali12:31 PM

    /* using pointer to structure */
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    struct book *p;
    printf("Enter the name of book");
    scanf("%s",p->name);
    printf("\n\t enter price");
    scanf("%f",&p->price);
    printf("\n\t enter pages");
    scanf("%d",&p->pages);
    printf("\n\t name=%s\n\tprice=%f\n\tpages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  15. Dipali Kore8:42 AM

    /*To Display the name of book,pages and price using pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price ;
    int pages;
    }b;
    struct book *p;
    p=&b;
    printf("\n\t Enter name of Book");
    scanf("%s",p->name);
    printf("\n\tEnter price of Book");
    scanf("%f",&p->price);
    printf("\n\tEnter pages of Book");
    scanf("%d",&p->pages);
    printf("\n\tBook name=%s \n\tBook price=%f \n\tBook pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  16. Radha Ghadge SE 238:53 AM

    #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }x;
    struct book *p;
    p=&x;
    printf("\n\t Enter name of Book");
    scanf("%s",&p->name);
    printf("\n\tEnter price of Book");
    scanf("%f",&p->price);
    printf("\n\tEnter pages of Book");
    scanf("%d",&p->pages);
    printf("\n\tBook name=%s \n\tBook price=%f \n\tBook pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  17. #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }b;
    struct book *k;
    k=&b;
    printf("\n Book name=");
    scanf("%s",k->name);
    printf("\n Price=");
    scanf("%f",&k->price);
    printf("\n Enter no of pages=");
    scanf("%d",&k->pages);
    printf(" \n Name of book=%s \t Price of book=%f \tPages in book=%d \n",k->name,k->price,k->pages);
    }

    ReplyDelete
  18. poonam pusavale9:31 AM

    /*display name,price,pages of book using pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    struct book *p;
    printf("\n\t enter name of book");
    scanf("%s",p->name);
    printf("\n\t enter price of book");
    scanf("%f",&p->price);
    printf("\n\t enter pages of book");
    scanf("%d",&p->pages);
    printf("\n\tname=%s \n\tprice=%f \n\tpages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  19. Bhosale Dhanashri SE39:48 AM

    // structure of book by using pointer to structure
    #include
    #include
    void main()
    {

    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;

    struct book *p;

    printf("Enter NAME of book...");
    scanf("%s",p->name);

    printf("Enter Price of book...");
    scanf("%f",&p->price);

    printf("Enter Pages of book...");
    scanf("%d",&p->pages);

    printf("\nBook name=%s \nBook Price=%f \n Book Pages=%d\n",p->name,p->price,p->pages);
    }

    ReplyDelete
  20. sonali nagane9:51 AM

    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    struct book*p;
    {printf("\n enter the name of book");
    scanf("%s",p->name);
    printf("\n enter the price of book");
    scanf("\%f",&p->price);
    printf("\n enter the pages of book");
    scanf("\%d",&p->pages);
    printf("\n\tbook name=%s,book price=%f,book pages=%d",p->name,p->price,p->pages);
    }
    }




    ReplyDelete
  21. puja khandare10:00 AM

    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price ;
    int pages;
    }b;
    struct book *p;
    p=&b;
    printf("\n\t Enter name of Book");
    scanf("%s",p->name);
    printf("\n\tEnter price of Book");
    scanf("%f",&p->price);
    printf("\n\tEnter pages of Book");
    scanf("%d",&p->pages);
    printf("\n\tBook name=%s \n\tBook price=%f \n\tBook pages=%d",p->name,p->price,p->pages);
    }

    ReplyDelete
  22. sushma jadhav10:00 AM

    // accept the information of book using pointer
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    struct book *ptr,p;
    ptr=&p;
    printf("\n\tEnter book name\nprice\npages");
    scanf("%s\t%f\t%d",ptr->name,&ptr->price,&ptr->pages);
    printf("\nBook name=%s \tBook price=%f \t Book pages=%d",ptr->name,ptr->price,ptr->pages);
    }

    ReplyDelete
  23. Bhanvase Yashoda10:27 AM

    /* pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    int pages;
    float price;
    }b;
    struct book *p;
    printf("\n\t enter name");
    scanf("%s",p->name);
    printf("\n\t enter pages");
    scanf("%d",&p->pages);
    printf("\n\t enter price");
    scanf("%f",& p->price);

    printf("name=%spages=%dprice=%f",p->name,p->pages,p->price);
    }

    ReplyDelete
  24. Bhosale Dhanashri SE312:13 PM

    #include
    #include
    void main()
    {
    struct book
    {

    int pages;
    char name[10];
    float price;
    }b;
    struct book *p;
    p=&b;


    printf("\n\t Enter the pages of book==");
    scanf("%d",&p->pages);
    printf("\n\t Enter the name of book==");
    scanf("%s",p->name);
    printf("\n\t Enter the price of book==");
    scanf("%f",&p->price);

    printf("\n\t pages of book=%d ,name ofbook=%s,priceofbook =%f",p->pages,p->name,p->price);

    }














    ReplyDelete
  25. Awate Snehal11:11 AM

    /*Pointer to structure*/
    #include
    void main()
    {
    struct book
    {
    char name[20];
    int price;
    int pages;
    }b;
    struct book *p;
    {
    printf("\n enter name");
    scanf("%s",p->name);
    printf("\n enter price");
    scanf("%d",&p->price);
    printf("\n enter pages");
    scanf("%d",&p->pages);
    printf("\n\t name=%s price=%d pages=%d",p->name,p->price,p->pages);
    }
    }

    ReplyDelete
  26. sachita jadhav11:27 AM

    /* pointer to structure */
    #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }b;

    struct book *p1;
    p1=&b;
    printf("\n enter name of book");
    scanf("%s",p1->name);
    printf("\n enter price of book");
    scanf("%f",&p1->price);
    printf("\n enter pages of book" );
    scanf("%d",&p1->pages);
    printf("\n name of book=%s \n price of book=%f \n pages of book=%d ",p1->name,p1->price,p1->pages);
    }

    ReplyDelete

Post a Comment