by Dinesh Thakur Category: Array Pointer and Union

 

#include<iostream.h>

#include<conio.h>
#include<string.h>
void main ()
{
               struct lib_books
           {
                   char title[20];
                   char author[15];
                   int pages;
                   float price;
           };
      struct lib_books book1 ;
      clrscr();
      strcpy(book1.title, "C++ Programming");
      strcpy(book1.author, "Dinesh Thakur");
      book1.pages = 500;
      book1.price = 285.50;
      cout<<"\n Title of the Book is "<<book1.title;
      cout<<"\n Author of the Book is "<<book1.author;
      cout<<"\n Pages of the Book are "<<book1.pages;
      cout<<"\n Price of the Book is "<<book1.price;
      getch();
}

Library Data By Using Structure



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles