19. Display name of book,pages and price using structure.


Comments

  1. /* Display name of book,pages and price using structure.*/

    #include

    void main()
    {

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

    printf("\n Enter the name of the book::\n");
    scanf("%s",b.name);

    printf("\n Enter the price of the book::\n");
    scanf("%f",&b.price);

    printf("\n Enter the no of pages of the book::\n");
    scanf("%d",&b.pages);

    printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
    }

    ReplyDelete
    Replies
    1. mayuri magar10:26 AM

      #include

      void main()
      {

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

      printf("\n Enter the name of the book::\n");
      scanf("%s",b.name);

      printf("\n Enter the price of the book::\n");
      scanf("%f",&b.price);

      printf("\n Enter the no of pages of the book::\n");
      scanf("%d",&b.pages);

      printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
      }

      Delete
  2. /* Display the information of book using stucture */

    #include

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

    printf("\nEnter the book name...");
    scanf("%s",b.name);

    printf("\nEnter the price of book...");
    scanf("%f",&b.price);

    printf("\nEnter the pages of book....");
    scanf("%d",&b.page);

    printf("\nBook Name=%s \nBook price=%f \nBook page=%d",b.name,b.price,b.page);
    }

    ReplyDelete
  3. Pandhare Dipali Rajendra12:18 PM

    #include
    void main()
    {
    struct book
    {
    char name;
    float price;
    int pages;
    }b;
    printf("\n\t Enter the name of book:")
    scanf("%s",b.name);
    printf("\n\t Enter the price of book:");
    scanf("%f",&b.price);
    printf("\n\t Enter the pages of book:");
    scanf("%d",&b.pages);
    printf("\n\t book name=%s,book price=%f,book pages=%d",b.name,b.price,b.pages);
    }
    }

    ReplyDelete
  4. yogesh12:20 PM

    /* Display name of book,pages and price using structure.*/

    #include

    void main()
    {

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

    printf("\n Enter the name of the book::\n");
    scanf("%s",b.name);

    printf("\n Enter the price of the book::\n");
    scanf("%f",&b.price);

    printf("\n Enter the no of pages of the book::\n");
    scanf("%d",&b.pages);

    printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
    }

    ReplyDelete
  5. Akshay Sidwadkar12:29 PM

    /* Display the information of book using stucture */

    #include

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

    printf("\nEnter the book name...");
    scanf("%s",b.name);

    printf("\nEnter the price of book...");
    scanf("%f",&b.price);

    printf("\nEnter the pages of book....");
    scanf("%d",&b.page);

    printf("\nBook Name=%s \nBook price=%f \nBook page=%d",b.name,b.price,b.page);
    }

    ReplyDelete
  6. Mubin Pirjade8:51 AM

    correct program,only here!!@mubin
    // to display book info.
    #include
    void main()
    {
    struct book
    {
    int pg;
    char n[20];
    float pr;
    };
    struct book b1={200,"physics",427.50};
    printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr);
    }

    ReplyDelete
  7. yogesh9:12 AM

    /* Display name of book,pages and price using structure.*/

    #include

    void main()
    {

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

    printf("\n Enter the name of the book::\n");
    scanf("%s",b.name);

    printf("\n Enter the price of the book::\n");
    scanf("%f",&b.price);

    printf("\n Enter the no of pages of the book::\n");
    scanf("%d",&b.pages);

    printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
    }

    ReplyDelete
  8. Swati Waghmare10:03 AM

    /*To display the information about book*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    {
    printf("\n\t Enter the name of book");
    scanf("%s",b.name);

    printf("\n\t Enter the price of book");
    scanf("%f",&b.price);

    printf("\n\t Enter the no of pages of book");
    scanf("%d",&b.pages);

    printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages);
    }
    }

    ReplyDelete
  9. poonam pusavale10:30 AM

    /*name ,price,pagesof book using structure*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    printf("\n\t enter name of book");
    scanf("%s",b.name);
    printf("\n\t enter price of book");
    scanf("%f",&b.price);
    printf("\n\t enter pages of book");
    scanf("%d",&b.pages);
    printf("\n\t book name=%s \n\tbook price=%f \n\tbook pages=%d",b.name,b.price,b.pages);
    }

    ReplyDelete
  10. lengarepooja3:57 PM

    #include
    void main()
    {
    struct book
    {
    char name[30];

    float price;
    int pages;
    }b;
    printf("\nEnter the name of book:\n");
    scanf("%s",b.name);
    printf("\nEnter the price of book:\n");
    scanf("%f",&b.price);
    printf("\nEnter the pages of book:\n");
    scanf("%d",&b.pages);
    printf("\nInformation about book:\n");
    printf("\nName of book:%s\nPrice of book=%f\nPages of book:%d\n",b.name,b.price,b.pages);

    }

    ReplyDelete
  11. /* Book information are Display*/
    #include

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

    }b;


    printf("\nenter name of book=");
    scanf("%s",b.name);

    printf("enter price of book=");
    scanf("%f",&b.price);

    printf("enter pages of book=");
    scanf("%d",&b.pages);



    printf("\nbook name=%s,\nbook price=%f,\nbook pages=%d",b.name,b.price,b.pages);
    }

    ReplyDelete
  12. Pallavi Bagal4:29 PM

    #include
    void main()
    {
    struct Book
    {
    char name[10];
    float price;
    int pages;
    }b;
    int i;
    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("\n\tBook Name=%s,\n\tBook Price=%f,\n\tBook pages=%d",b.name,b.price,b.pages);

    }

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

    float price;
    int pages;
    }b;
    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
  14. Sayali Daunde12:38 PM

    // to display book info.
    #include
    void main()
    {
    struct book
    {
    int pg;
    char n[20];
    float pr;
    };
    struct book b1={200,"physics",427.50};
    printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr);
    }

    ReplyDelete
  15. Dipali Kore1:04 PM

    //display n count even no using while loop
    #include
    void main()
    {
    int count=0,i=1;

    while(i<=100)
    {
    if(i%2==0)
    {
    printf("\ngiven even no==%d",i);

    count++;
    }
    i++;


    }
    printf("\ntotal even no=%d",count);
    }

    ReplyDelete
  16. Radha Ghadge SE 231:12 PM

    #include
    void main()
    {
    struct book
    {
    char name[20];
    int pages;
    int price;
    }x;
    printf("\n enter the book name=");
    scanf("%s",&x.name);
    printf("\n enter the pages=");
    scanf("%d",&x.pages);
    printf("\n enter the price=");
    scanf("%d",&x.price);

    printf("\n name=%s",x.name);
    printf("\n pages=%d",x.pages);
    printf("\n price=%d",x.price);
    }

    ReplyDelete
  17. sanjivani atakare4:41 PM

    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    printf("\n\tEnter the name of book");
    scanf("%s",b.name);
    printf("\n\tEnter the price of book");
    scanf("%f",&b.price);
    printf("\n\tEnter the pages of book");
    scanf("%d",&b.pages);


    printf("\n\tBook Name=%s,Book Price=%f,Book Pages=%d",b.name,b.price,b.pages);
    }

    ReplyDelete
  18. // Using structure display details about book
    #include
    #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int page;
    }b;
    printf("\n Enter name of book=");
    gets(b.name);
    printf("\n Enter price of book=");
    scanf("%f",&b.price);
    printf("\n Enter pages in book=");
    scanf("%d",&b.page);
    printf("\n Name of book=%s");
    puts(b.name);
    printf("\n Price of book=%f \n Pages in book=%d\n",b.price,b.page);
    }

    ReplyDelete
  19. sushma jadhav11:24 AM

    //Book strcture
    #include
    void main()
    {
    struct book
    {
    char name[10];
    int pages;
    float price;
    }b;
    printf("Enter name\n pages \n price");
    scanf("\n%s\n%d\n%f",b.name,&b.pages,&b.price);
    printf("nane=%s \npages=%d \nprice=%f",b.name,b.pages,b.price);
    }

    ReplyDelete
  20. Dipali Kore11:39 AM

    //display info of book
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    printf("\n\tEnter the name of book");
    scanf("%s",b.name);
    printf("\n\tEnter the price of book");
    scanf("%f",&b.price);
    printf("\n\tEnter the pages of book");
    scanf("%d",&b.pages);


    printf("\n\tBook Name=%s,Book Price=%f,Book Pages=%d",b.name,b.price,b.pages);
    }

    ReplyDelete
  21. puja khandare12:06 PM

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

    ReplyDelete
  22. Bhosale Dhanashri SE312:07 PM

    //program of displaying structure of book



    #include

    void main()
    {

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

    printf("\n Enter the name of the book::\n");
    scanf("%s",b.name);

    printf("\n Enter the price of the book::\n");
    scanf("%f",&b.price);

    printf("\n Enter the no of pages of the book::\n");
    scanf("%d",&b.pages);

    printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);

    }



    ReplyDelete
  23. sonali nagane12:08 PM

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




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




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




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

    ReplyDelete
  25. sushmita swami8:55 AM

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

    ReplyDelete
  26. Bhanvase Yashoda9:36 AM

    /* add of 2d array*/
    #include
    void main()
    {
    int a[2][2];int b[2][2];
    int c[2][2]; int i,j;
    for(i=0;i<=1;i++)
    {
    for(j=0;j<=1;j++)
    {
    printf("\n\t enter 1st array");
    scanf("%d",&a[i][j]);
    }
    }
    for(i=0;i<=1;i++)
    {
    for(j=0;j<=1;j++)
    {
    printf("\n\t enter array");
    scanf("%d",&b[i][j]);
    }
    }
    for(i=0;i<=1;i++)
    {
    for(j=0;j<=1;j++)
    {
    c[i][j]=a[i][j]+b[i][j];
    printf("%d",&c[i][j]);
    }
    }

    }








    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. // to display book info using structure
    #include
    void main()
    {
    struct bk
    {
    int pagge;
    char name[20];
    float prize;
    };
    struct bk b={400,"Data Structure",500.50};
    printf("\n\tPages:%d \n\t Name of book:%s \n\t Price:%f", b.pg,b.n,b.pr);
    }

    ReplyDelete
  29. Ranjit Kalubarme3:48 PM

    #include
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    void main()
    {
    printf("\n\tenter the name of book");
    scanf("%s",&b.name);
    printf("\n\tenter the price of book");
    scanf("%f",&b.price);
    printf("\n\tenter the pages of book");
    scanf("%d",&b.pages);
    printf("\n\tthe name of the book=%s,\nthe price of the book=%f,\nthe pages of the book=%d\n",b.name,b.price,b.pages);
    }

    ReplyDelete
  30. rajashree bhosale SE444:51 PM

    #include
    void main()
    {

    struct book
    {
    char Name[10];
    float price;
    int page;
    }
    b[10];
    int i;
    for(i=0;i<=9;i++)
    {
    printf("\n enter name of book");
    scanf("%s",b[i].Name);
    printf("\n enter price of book");
    scanf("%f",&b[i].price);
    printf("\n enter page of book");
    scanf("%d",&b[i].page);

    }

    for(i=0;i<=9;i++)
    {

    printf("\n Name=%s,price=%f, page=%d",b[i].Name,b[i].price,b[i].page);
    }
    }

    ReplyDelete
  31. madhuri pujari5:05 PM

    #include
    void main()
    {
    struct book
    {
    int pages;
    float price;
    char name[10];
    }b;
    printf("Enter the name");
    scanf("\n%s",b.name);
    printf("Enter the price");
    scanf("\n%f",&b.price);
    printf("Enter the pages");
    scanf("\n%d",&b.pages);
    printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b.name,b.price,b.pages);

    }

    ReplyDelete
  32. Ranjit kalubarme11:56 AM

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

    ReplyDelete
  33. Wadegonkar Aishwarya9:47 AM

    /*To display the information about book*/
    #include
    void main()
    {
    struct book
    {
    char name[10];
    float price;
    int pages;
    }b;
    {
    printf("\n\t Enter the name of book");
    scanf("%s",b.name);

    printf("\n\t Enter the price of book");
    scanf("%f",&b.price);

    printf("\n\t Enter the no of pages of book");
    scanf("%d",&b.pages);

    printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages);
    }
    }

    ReplyDelete
  34. Awate Snehal12:37 PM

    /*Book info using structure*/
    #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }b;
    int i;
    printf("\n enter name of book");
    scanf("%s",b.name);
    printf("\n enter price of book");
    scanf("%f",&b.price);
    printf("\n enter pages of book");
    scanf("%d",&b.pages);
    printf("\n\t book name=%s book price=%f book pages=%d",b.name,b.price,b.pages);
    }

    ReplyDelete
  35. sachita jadhav11:37 AM

    #include
    void main()
    {
    struct book
    {
    char name[20];
    float price;
    int pages;
    }b;
    printf("\n\t enter book name \n\t enter price \n\tenter pages");
    scanf("%s%f%d",b.name,&b.price,&b.pages);
    printf("\n\tname=%s \n\t price=%f \n\tpages=%d",b.name ,b.price,b.pages);
    }

    ReplyDelete

Post a Comment