Answer to Question #151762 in C++ for Isha

Question #151762
Write a program in C++ to store the book information in a library using structure. Write functions to update the book information also program
1
Expert's answer
2020-12-17T08:56:50-0500
#include <iostream>
using namespace std;
 
// A structure for book
struct Book {
    char name[100];
    int price;
    int ISBN;
};
 
int main() {
    Book book;
    cout << "Enter name of book\n";
    cin.getline(book.name, 100);
    cout << "Enter price of employee\n";
    cin >> book.price;
    cout << "Enter ISBN code\n";
    cin >> book.ISBN;
     
    // Printing Book details 
    cout << "\n*** Book Details ***" << endl;
    cout << "Name : " << book.name << endl;
    cout << "Price : " << book.price << endl;
    cout << "ISBN Code : " << book.ISBN << endl;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog